From 00f04a7ce85b5a5cb73899735a30298993a243fe Mon Sep 17 00:00:00 2001 From: Derek Strickland Date: Wed, 15 Jun 2022 16:50:36 -0400 Subject: [PATCH 1/7] fix map spec generation and add nullable fields --- Makefile | 4 +- clients/go/v1/.openapi-generator/VERSION | 2 +- clients/go/v1/README.md | 12 +- clients/go/v1/api/openapi.yaml | 974 +- clients/go/v1/api_acl.go | 729 +- clients/go/v1/api_allocations.go | 296 +- clients/go/v1/api_deployments.go | 516 +- clients/go/v1/api_enterprise.go | 310 +- clients/go/v1/api_evaluations.go | 222 +- clients/go/v1/api_jobs.go | 1322 ++- clients/go/v1/api_metrics.go | 74 +- clients/go/v1/api_namespaces.go | 309 +- clients/go/v1/api_nodes.go | 430 +- clients/go/v1/api_operator.go | 438 +- clients/go/v1/api_plugins.go | 154 +- clients/go/v1/api_regions.go | 72 +- clients/go/v1/api_scaling.go | 156 +- clients/go/v1/api_search.go | 156 +- clients/go/v1/api_status.go | 150 +- clients/go/v1/api_system.go | 122 +- clients/go/v1/api_volumes.go | 672 +- clients/go/v1/client.go | 59 +- clients/go/v1/configuration.go | 14 +- clients/go/v1/docs/ACLApi.md | 48 +- clients/go/v1/docs/ACLToken.md | 12 +- clients/go/v1/docs/ACLTokenListStub.md | 12 +- clients/go/v1/docs/AllocDeploymentStatus.md | 12 +- clients/go/v1/docs/AllocatedResources.md | 12 +- clients/go/v1/docs/AllocatedTaskResources.md | 24 +- clients/go/v1/docs/Allocation.md | 72 +- clients/go/v1/docs/AllocationListStub.md | 36 +- clients/go/v1/docs/AllocationsApi.md | 16 +- clients/go/v1/docs/CSIInfo.md | 36 +- clients/go/v1/docs/CSINodeInfo.md | 12 +- clients/go/v1/docs/CSIVolume.md | 36 +- clients/go/v1/docs/CSIVolumeListStub.md | 12 +- clients/go/v1/docs/ConsulConnect.md | 24 +- clients/go/v1/docs/ConsulGateway.md | 36 +- .../go/v1/docs/ConsulIngressConfigEntry.md | 12 +- clients/go/v1/docs/ConsulProxy.md | 12 +- clients/go/v1/docs/ConsulSidecarService.md | 12 +- clients/go/v1/docs/ConsulUpstream.md | 12 +- clients/go/v1/docs/DeploymentState.md | 12 +- clients/go/v1/docs/DeploymentsApi.md | 32 +- clients/go/v1/docs/DrainMetadata.md | 24 +- clients/go/v1/docs/DrainStrategy.md | 24 +- clients/go/v1/docs/DriverInfo.md | 12 +- clients/go/v1/docs/EnterpriseApi.md | 20 +- clients/go/v1/docs/Evaluation.md | 12 +- clients/go/v1/docs/EvaluationStub.md | 12 +- clients/go/v1/docs/EvaluationsApi.md | 12 +- clients/go/v1/docs/Job.md | 24 +- clients/go/v1/docs/JobEvaluateRequest.md | 12 +- clients/go/v1/docs/JobListStub.md | 12 +- clients/go/v1/docs/JobPlanRequest.md | 12 +- clients/go/v1/docs/JobPlanResponse.md | 36 +- clients/go/v1/docs/JobRegisterRequest.md | 12 +- clients/go/v1/docs/JobSummary.md | 12 +- clients/go/v1/docs/JobValidateRequest.md | 12 +- clients/go/v1/docs/JobsApi.md | 84 +- clients/go/v1/docs/MetricsApi.md | 4 +- clients/go/v1/docs/Namespace.md | 12 +- clients/go/v1/docs/NamespacesApi.md | 20 +- clients/go/v1/docs/NetworkResource.md | 12 +- clients/go/v1/docs/Node.md | 72 +- clients/go/v1/docs/NodeDevice.md | 12 +- clients/go/v1/docs/NodeEvent.md | 12 +- clients/go/v1/docs/NodeListStub.md | 36 +- clients/go/v1/docs/NodeReservedResources.md | 48 +- clients/go/v1/docs/NodeResources.md | 36 +- clients/go/v1/docs/NodeUpdateDrainRequest.md | 12 +- clients/go/v1/docs/NodesApi.md | 24 +- clients/go/v1/docs/OneTimeToken.md | 12 +- clients/go/v1/docs/OperatorApi.md | 28 +- clients/go/v1/docs/PluginsApi.md | 8 +- clients/go/v1/docs/QuotaLimit.md | 12 +- clients/go/v1/docs/RegionsApi.md | 4 +- clients/go/v1/docs/ScalingApi.md | 8 +- clients/go/v1/docs/SchedulerConfiguration.md | 25 +- .../v1/docs/SchedulerConfigurationResponse.md | 12 +- clients/go/v1/docs/SearchApi.md | 8 +- clients/go/v1/docs/ServerHealth.md | 12 +- clients/go/v1/docs/Service.md | 24 +- clients/go/v1/docs/ServiceCheck.md | 12 +- clients/go/v1/docs/SidecarTask.md | 12 +- clients/go/v1/docs/StatusApi.md | 8 +- clients/go/v1/docs/SystemApi.md | 8 +- clients/go/v1/docs/Task.md | 60 +- clients/go/v1/docs/TaskGroup.md | 24 +- clients/go/v1/docs/TaskState.md | 48 +- clients/go/v1/docs/VolumeRequest.md | 12 +- clients/go/v1/docs/VolumesApi.md | 44 +- clients/go/v1/model_acl_policy.go | 14 +- clients/go/v1/model_acl_policy_list_stub.go | 14 +- clients/go/v1/model_acl_token.go | 54 +- clients/go/v1/model_acl_token_list_stub.go | 54 +- clients/go/v1/model_affinity.go | 14 +- .../go/v1/model_alloc_deployment_status.go | 46 +- clients/go/v1/model_alloc_stop_response.go | 14 +- .../go/v1/model_allocated_cpu_resources.go | 14 +- .../go/v1/model_allocated_device_resource.go | 22 +- .../go/v1/model_allocated_memory_resources.go | 14 +- clients/go/v1/model_allocated_resources.go | 46 +- .../go/v1/model_allocated_shared_resources.go | 30 +- .../go/v1/model_allocated_task_resources.go | 94 +- clients/go/v1/model_allocation.go | 214 +- clients/go/v1/model_allocation_list_stub.go | 118 +- clients/go/v1/model_allocation_metric.go | 30 +- clients/go/v1/model_attribute.go | 14 +- .../go/v1/model_autopilot_configuration.go | 14 +- clients/go/v1/model_check_restart.go | 14 +- clients/go/v1/model_constraint.go | 14 +- clients/go/v1/model_consul.go | 14 +- clients/go/v1/model_consul_connect.go | 78 +- clients/go/v1/model_consul_expose_config.go | 22 +- clients/go/v1/model_consul_expose_path.go | 14 +- clients/go/v1/model_consul_gateway.go | 112 +- .../v1/model_consul_gateway_bind_address.go | 14 +- clients/go/v1/model_consul_gateway_proxy.go | 22 +- .../go/v1/model_consul_gateway_tls_config.go | 14 +- .../v1/model_consul_ingress_config_entry.go | 54 +- .../go/v1/model_consul_ingress_listener.go | 22 +- clients/go/v1/model_consul_ingress_service.go | 22 +- clients/go/v1/model_consul_linked_service.go | 14 +- clients/go/v1/model_consul_mesh_gateway.go | 14 +- clients/go/v1/model_consul_proxy.go | 62 +- clients/go/v1/model_consul_sidecar_service.go | 54 +- .../model_consul_terminating_config_entry.go | 22 +- clients/go/v1/model_consul_upstream.go | 46 +- clients/go/v1/model_csi_controller_info.go | 14 +- clients/go/v1/model_csi_info.go | 110 +- clients/go/v1/model_csi_mount_options.go | 22 +- clients/go/v1/model_csi_node_info.go | 46 +- clients/go/v1/model_csi_plugin.go | 22 +- clients/go/v1/model_csi_plugin_list_stub.go | 14 +- clients/go/v1/model_csi_snapshot.go | 14 +- .../v1/model_csi_snapshot_create_request.go | 22 +- .../v1/model_csi_snapshot_create_response.go | 22 +- .../go/v1/model_csi_snapshot_list_response.go | 22 +- clients/go/v1/model_csi_topology.go | 14 +- clients/go/v1/model_csi_topology_request.go | 30 +- clients/go/v1/model_csi_volume.go | 134 +- clients/go/v1/model_csi_volume_capability.go | 14 +- .../go/v1/model_csi_volume_create_request.go | 22 +- .../go/v1/model_csi_volume_external_stub.go | 22 +- ...model_csi_volume_list_external_response.go | 22 +- clients/go/v1/model_csi_volume_list_stub.go | 54 +- .../v1/model_csi_volume_register_request.go | 22 +- clients/go/v1/model_deployment.go | 14 +- .../model_deployment_alloc_health_request.go | 30 +- .../go/v1/model_deployment_pause_request.go | 14 +- .../go/v1/model_deployment_promote_request.go | 22 +- clients/go/v1/model_deployment_state.go | 54 +- .../go/v1/model_deployment_unblock_request.go | 14 +- .../go/v1/model_deployment_update_response.go | 14 +- clients/go/v1/model_desired_transition.go | 14 +- clients/go/v1/model_desired_updates.go | 14 +- .../go/v1/model_dispatch_payload_config.go | 14 +- clients/go/v1/model_dns_config.go | 38 +- clients/go/v1/model_drain_metadata.go | 78 +- clients/go/v1/model_drain_spec.go | 14 +- clients/go/v1/model_drain_strategy.go | 78 +- clients/go/v1/model_driver_info.go | 46 +- clients/go/v1/model_ephemeral_disk.go | 14 +- clients/go/v1/model_eval_options.go | 14 +- clients/go/v1/model_evaluation.go | 54 +- clients/go/v1/model_evaluation_stub.go | 46 +- clients/go/v1/model_field_diff.go | 22 +- clients/go/v1/model_fuzzy_match.go | 22 +- clients/go/v1/model_fuzzy_search_request.go | 14 +- clients/go/v1/model_fuzzy_search_response.go | 14 +- clients/go/v1/model_gauge_value.go | 14 +- clients/go/v1/model_host_network_info.go | 14 +- clients/go/v1/model_host_volume_info.go | 14 +- clients/go/v1/model_job.go | 118 +- clients/go/v1/model_job_children_summary.go | 14 +- .../go/v1/model_job_deregister_response.go | 14 +- clients/go/v1/model_job_diff.go | 38 +- clients/go/v1/model_job_dispatch_request.go | 14 +- clients/go/v1/model_job_dispatch_response.go | 14 +- clients/go/v1/model_job_evaluate_request.go | 46 +- clients/go/v1/model_job_list_stub.go | 54 +- clients/go/v1/model_job_plan_request.go | 46 +- clients/go/v1/model_job_plan_response.go | 118 +- clients/go/v1/model_job_register_request.go | 46 +- clients/go/v1/model_job_register_response.go | 14 +- clients/go/v1/model_job_revert_request.go | 14 +- .../go/v1/model_job_scale_status_response.go | 14 +- clients/go/v1/model_job_stability_request.go | 14 +- clients/go/v1/model_job_stability_response.go | 14 +- clients/go/v1/model_job_summary.go | 46 +- clients/go/v1/model_job_validate_request.go | 46 +- clients/go/v1/model_job_validate_response.go | 22 +- clients/go/v1/model_job_versions_response.go | 30 +- clients/go/v1/model_jobs_parse_request.go | 14 +- clients/go/v1/model_log_config.go | 14 +- clients/go/v1/model_metrics_summary.go | 46 +- clients/go/v1/model_migrate_strategy.go | 14 +- clients/go/v1/model_multiregion.go | 22 +- clients/go/v1/model_multiregion_region.go | 22 +- clients/go/v1/model_multiregion_strategy.go | 14 +- clients/go/v1/model_namespace.go | 46 +- clients/go/v1/model_namespace_capabilities.go | 30 +- clients/go/v1/model_network_resource.go | 62 +- clients/go/v1/model_node.go | 214 +- clients/go/v1/model_node_cpu_resources.go | 22 +- clients/go/v1/model_node_device.go | 46 +- clients/go/v1/model_node_device_locality.go | 14 +- clients/go/v1/model_node_device_resource.go | 22 +- clients/go/v1/model_node_disk_resources.go | 14 +- .../go/v1/model_node_drain_update_response.go | 22 +- .../model_node_eligibility_update_response.go | 22 +- clients/go/v1/model_node_event.go | 46 +- clients/go/v1/model_node_list_stub.go | 110 +- clients/go/v1/model_node_memory_resources.go | 14 +- clients/go/v1/model_node_purge_response.go | 22 +- .../v1/model_node_reserved_cpu_resources.go | 14 +- .../v1/model_node_reserved_disk_resources.go | 14 +- .../model_node_reserved_memory_resources.go | 14 +- .../model_node_reserved_network_resources.go | 14 +- .../go/v1/model_node_reserved_resources.go | 142 +- clients/go/v1/model_node_resources.go | 126 +- clients/go/v1/model_node_score_meta.go | 14 +- .../go/v1/model_node_update_drain_request.go | 46 +- .../model_node_update_eligibility_request.go | 14 +- clients/go/v1/model_object_diff.go | 30 +- clients/go/v1/model_one_time_token.go | 46 +- .../model_one_time_token_exchange_request.go | 14 +- clients/go/v1/model_operator_health_reply.go | 22 +- .../go/v1/model_parameterized_job_config.go | 30 +- clients/go/v1/model_periodic_config.go | 14 +- .../go/v1/model_periodic_force_response.go | 14 +- clients/go/v1/model_plan_annotations.go | 22 +- clients/go/v1/model_point_value.go | 22 +- clients/go/v1/model_port.go | 14 +- clients/go/v1/model_port_mapping.go | 14 +- clients/go/v1/model_preemption_config.go | 14 +- clients/go/v1/model_quota_limit.go | 46 +- clients/go/v1/model_quota_spec.go | 22 +- clients/go/v1/model_raft_configuration.go | 22 +- clients/go/v1/model_raft_server.go | 14 +- clients/go/v1/model_requested_device.go | 30 +- clients/go/v1/model_reschedule_event.go | 14 +- clients/go/v1/model_reschedule_policy.go | 14 +- clients/go/v1/model_reschedule_tracker.go | 22 +- clients/go/v1/model_resources.go | 30 +- clients/go/v1/model_restart_policy.go | 14 +- clients/go/v1/model_sampled_value.go | 14 +- clients/go/v1/model_scaling_event.go | 22 +- clients/go/v1/model_scaling_policy.go | 22 +- .../go/v1/model_scaling_policy_list_stub.go | 14 +- clients/go/v1/model_scaling_request.go | 22 +- .../go/v1/model_scheduler_configuration.go | 78 +- .../model_scheduler_configuration_response.go | 46 +- ...el_scheduler_set_configuration_response.go | 14 +- clients/go/v1/model_search_request.go | 14 +- clients/go/v1/model_search_response.go | 14 +- clients/go/v1/model_server_health.go | 46 +- clients/go/v1/model_service.go | 102 +- clients/go/v1/model_service_check.go | 54 +- clients/go/v1/model_service_registration.go | 22 +- clients/go/v1/model_sidecar_task.go | 54 +- clients/go/v1/model_spread.go | 22 +- clients/go/v1/model_spread_target.go | 14 +- clients/go/v1/model_task.go | 238 +- clients/go/v1/model_task_artifact.go | 14 +- clients/go/v1/model_task_csi_plugin_config.go | 14 +- clients/go/v1/model_task_diff.go | 38 +- clients/go/v1/model_task_event.go | 14 +- clients/go/v1/model_task_group.go | 126 +- clients/go/v1/model_task_group_diff.go | 38 +- .../go/v1/model_task_group_scale_status.go | 22 +- clients/go/v1/model_task_group_summary.go | 14 +- clients/go/v1/model_task_handle.go | 14 +- clients/go/v1/model_task_lifecycle.go | 14 +- clients/go/v1/model_task_state.go | 150 +- clients/go/v1/model_template.go | 14 +- clients/go/v1/model_update_strategy.go | 14 +- clients/go/v1/model_vault.go | 22 +- clients/go/v1/model_volume_mount.go | 14 +- clients/go/v1/model_volume_request.go | 46 +- clients/go/v1/model_wait_config.go | 14 +- clients/go/v1/response.go | 14 +- clients/go/v1/utils.go | 14 +- clients/java/v1/.github/workflows/maven.yml | 30 + clients/java/v1/.openapi-generator/FILES | 2 + clients/java/v1/.openapi-generator/VERSION | 2 +- clients/java/v1/README.md | 13 +- clients/java/v1/api/openapi.yaml | 1031 +- clients/java/v1/build.gradle | 74 +- clients/java/v1/build.sbt | 22 +- clients/java/v1/docs/ACLPolicy.md | 14 +- clients/java/v1/docs/ACLPolicyListStub.md | 12 +- clients/java/v1/docs/ACLToken.md | 22 +- clients/java/v1/docs/ACLTokenListStub.md | 20 +- clients/java/v1/docs/AclApi.md | 360 +- clients/java/v1/docs/Affinity.md | 12 +- clients/java/v1/docs/AllocDeploymentStatus.md | 12 +- clients/java/v1/docs/AllocStopResponse.md | 8 +- clients/java/v1/docs/AllocatedCpuResources.md | 6 +- .../java/v1/docs/AllocatedDeviceResource.md | 12 +- .../java/v1/docs/AllocatedMemoryResources.md | 8 +- clients/java/v1/docs/AllocatedResources.md | 8 +- .../java/v1/docs/AllocatedSharedResources.md | 10 +- .../java/v1/docs/AllocatedTaskResources.md | 12 +- clients/java/v1/docs/Allocation.md | 70 +- clients/java/v1/docs/AllocationListStub.md | 54 +- clients/java/v1/docs/AllocationMetric.md | 32 +- clients/java/v1/docs/AllocationsApi.md | 152 +- clients/java/v1/docs/Attribute.md | 14 +- .../java/v1/docs/AutopilotConfiguration.md | 24 +- clients/java/v1/docs/CSIControllerInfo.md | 28 +- clients/java/v1/docs/CSIInfo.md | 22 +- clients/java/v1/docs/CSIMountOptions.md | 8 +- clients/java/v1/docs/CSINodeInfo.md | 18 +- clients/java/v1/docs/CSIPlugin.md | 30 +- clients/java/v1/docs/CSIPluginListStub.md | 22 +- clients/java/v1/docs/CSISnapshot.md | 24 +- .../java/v1/docs/CSISnapshotCreateRequest.md | 12 +- .../java/v1/docs/CSISnapshotCreateResponse.md | 16 +- .../java/v1/docs/CSISnapshotListResponse.md | 16 +- clients/java/v1/docs/CSITopology.md | 6 +- clients/java/v1/docs/CSITopologyRequest.md | 8 +- clients/java/v1/docs/CSIVolume.md | 70 +- clients/java/v1/docs/CSIVolumeCapability.md | 8 +- .../java/v1/docs/CSIVolumeCreateRequest.md | 12 +- clients/java/v1/docs/CSIVolumeExternalStub.md | 20 +- .../v1/docs/CSIVolumeListExternalResponse.md | 8 +- clients/java/v1/docs/CSIVolumeListStub.md | 40 +- .../java/v1/docs/CSIVolumeRegisterRequest.md | 12 +- clients/java/v1/docs/CheckRestart.md | 10 +- clients/java/v1/docs/Constraint.md | 10 +- clients/java/v1/docs/Consul.md | 6 +- clients/java/v1/docs/ConsulConnect.md | 12 +- clients/java/v1/docs/ConsulExposeConfig.md | 6 +- clients/java/v1/docs/ConsulExposePath.md | 12 +- clients/java/v1/docs/ConsulGateway.md | 12 +- .../java/v1/docs/ConsulGatewayBindAddress.md | 10 +- clients/java/v1/docs/ConsulGatewayProxy.md | 16 +- .../java/v1/docs/ConsulGatewayTLSConfig.md | 12 +- .../java/v1/docs/ConsulIngressConfigEntry.md | 8 +- clients/java/v1/docs/ConsulIngressListener.md | 10 +- clients/java/v1/docs/ConsulIngressService.md | 8 +- clients/java/v1/docs/ConsulLinkedService.md | 14 +- clients/java/v1/docs/ConsulMeshGateway.md | 6 +- clients/java/v1/docs/ConsulProxy.md | 14 +- clients/java/v1/docs/ConsulSidecarService.md | 12 +- .../v1/docs/ConsulTerminatingConfigEntry.md | 6 +- clients/java/v1/docs/ConsulUpstream.md | 16 +- clients/java/v1/docs/DNSConfig.md | 10 +- clients/java/v1/docs/Deployment.md | 30 +- .../v1/docs/DeploymentAllocHealthRequest.md | 16 +- .../java/v1/docs/DeploymentPauseRequest.md | 14 +- .../java/v1/docs/DeploymentPromoteRequest.md | 16 +- clients/java/v1/docs/DeploymentState.md | 24 +- .../java/v1/docs/DeploymentUnblockRequest.md | 12 +- .../java/v1/docs/DeploymentUpdateResponse.md | 16 +- clients/java/v1/docs/DeploymentsApi.md | 248 +- clients/java/v1/docs/DesiredTransition.md | 8 +- clients/java/v1/docs/DesiredUpdates.md | 20 +- clients/java/v1/docs/DispatchPayloadConfig.md | 6 +- clients/java/v1/docs/DrainMetadata.md | 14 +- clients/java/v1/docs/DrainSpec.md | 8 +- clients/java/v1/docs/DrainStrategy.md | 12 +- clients/java/v1/docs/DriverInfo.md | 14 +- clients/java/v1/docs/EnterpriseApi.md | 154 +- clients/java/v1/docs/EphemeralDisk.md | 10 +- clients/java/v1/docs/EvalOptions.md | 6 +- clients/java/v1/docs/Evaluation.md | 62 +- clients/java/v1/docs/EvaluationStub.md | 40 +- clients/java/v1/docs/EvaluationsApi.md | 110 +- clients/java/v1/docs/FieldDiff.md | 14 +- clients/java/v1/docs/FuzzyMatch.md | 8 +- clients/java/v1/docs/FuzzySearchRequest.md | 34 +- clients/java/v1/docs/FuzzySearchResponse.md | 18 +- clients/java/v1/docs/GaugeValue.md | 10 +- clients/java/v1/docs/HostNetworkInfo.md | 12 +- clients/java/v1/docs/HostVolumeInfo.md | 8 +- clients/java/v1/docs/Job.md | 78 +- clients/java/v1/docs/JobChildrenSummary.md | 10 +- clients/java/v1/docs/JobDeregisterResponse.md | 20 +- clients/java/v1/docs/JobDiff.md | 14 +- clients/java/v1/docs/JobDispatchRequest.md | 10 +- clients/java/v1/docs/JobDispatchResponse.md | 16 +- clients/java/v1/docs/JobEvaluateRequest.md | 14 +- clients/java/v1/docs/JobListStub.md | 38 +- clients/java/v1/docs/JobPlanRequest.md | 16 +- clients/java/v1/docs/JobPlanResponse.md | 18 +- clients/java/v1/docs/JobRegisterRequest.md | 22 +- clients/java/v1/docs/JobRegisterResponse.md | 22 +- clients/java/v1/docs/JobRevertRequest.md | 20 +- .../java/v1/docs/JobScaleStatusResponse.md | 16 +- clients/java/v1/docs/JobStabilityRequest.md | 16 +- clients/java/v1/docs/JobStabilityResponse.md | 6 +- clients/java/v1/docs/JobSummary.md | 16 +- clients/java/v1/docs/JobValidateRequest.md | 12 +- clients/java/v1/docs/JobValidateResponse.md | 12 +- clients/java/v1/docs/JobVersionsResponse.md | 18 +- clients/java/v1/docs/JobsApi.md | 654 +- clients/java/v1/docs/JobsParseRequest.md | 10 +- clients/java/v1/docs/LogConfig.md | 8 +- clients/java/v1/docs/MetricsApi.md | 22 +- clients/java/v1/docs/MetricsSummary.md | 14 +- clients/java/v1/docs/MigrateStrategy.md | 12 +- clients/java/v1/docs/Multiregion.md | 8 +- clients/java/v1/docs/MultiregionRegion.md | 12 +- clients/java/v1/docs/MultiregionStrategy.md | 8 +- clients/java/v1/docs/Namespace.md | 18 +- clients/java/v1/docs/NamespaceCapabilities.md | 8 +- clients/java/v1/docs/NamespacesApi.md | 152 +- clients/java/v1/docs/NetworkResource.md | 22 +- clients/java/v1/docs/Node.md | 62 +- clients/java/v1/docs/NodeCpuResources.md | 10 +- clients/java/v1/docs/NodeDevice.md | 12 +- clients/java/v1/docs/NodeDeviceLocality.md | 6 +- clients/java/v1/docs/NodeDeviceResource.md | 14 +- clients/java/v1/docs/NodeDiskResources.md | 6 +- .../java/v1/docs/NodeDrainUpdateResponse.md | 14 +- .../v1/docs/NodeEligibilityUpdateResponse.md | 14 +- clients/java/v1/docs/NodeEvent.md | 14 +- clients/java/v1/docs/NodeListStub.md | 38 +- clients/java/v1/docs/NodeMemoryResources.md | 6 +- clients/java/v1/docs/NodePurgeResponse.md | 10 +- .../java/v1/docs/NodeReservedCpuResources.md | 6 +- .../java/v1/docs/NodeReservedDiskResources.md | 6 +- .../v1/docs/NodeReservedMemoryResources.md | 6 +- .../v1/docs/NodeReservedNetworkResources.md | 6 +- clients/java/v1/docs/NodeReservedResources.md | 12 +- clients/java/v1/docs/NodeResources.md | 18 +- clients/java/v1/docs/NodeScoreMeta.md | 10 +- .../java/v1/docs/NodeUpdateDrainRequest.md | 12 +- .../v1/docs/NodeUpdateEligibilityRequest.md | 8 +- clients/java/v1/docs/NodesApi.md | 224 +- clients/java/v1/docs/ObjectDiff.md | 12 +- clients/java/v1/docs/OneTimeToken.md | 14 +- .../v1/docs/OneTimeTokenExchangeRequest.md | 6 +- clients/java/v1/docs/OperatorApi.md | 216 +- clients/java/v1/docs/OperatorHealthReply.md | 10 +- .../java/v1/docs/ParameterizedJobConfig.md | 10 +- clients/java/v1/docs/PeriodicConfig.md | 14 +- clients/java/v1/docs/PeriodicForceResponse.md | 10 +- clients/java/v1/docs/PlanAnnotations.md | 8 +- clients/java/v1/docs/PluginsApi.md | 74 +- clients/java/v1/docs/PointValue.md | 8 +- clients/java/v1/docs/Port.md | 12 +- clients/java/v1/docs/PortMapping.md | 12 +- clients/java/v1/docs/PreemptionConfig.md | 12 +- clients/java/v1/docs/QuotaLimit.md | 10 +- clients/java/v1/docs/QuotaSpec.md | 14 +- clients/java/v1/docs/RaftConfiguration.md | 8 +- clients/java/v1/docs/RaftServer.md | 16 +- clients/java/v1/docs/RegionsApi.md | 16 +- clients/java/v1/docs/RequestedDevice.md | 12 +- clients/java/v1/docs/RescheduleEvent.md | 10 +- clients/java/v1/docs/ReschedulePolicy.md | 16 +- clients/java/v1/docs/RescheduleTracker.md | 6 +- clients/java/v1/docs/Resources.md | 20 +- clients/java/v1/docs/RestartPolicy.md | 12 +- clients/java/v1/docs/SampledValue.md | 22 +- clients/java/v1/docs/ScalingApi.md | 74 +- clients/java/v1/docs/ScalingEvent.md | 20 +- clients/java/v1/docs/ScalingPolicy.md | 24 +- clients/java/v1/docs/ScalingPolicyListStub.md | 16 +- clients/java/v1/docs/ScalingRequest.md | 22 +- .../java/v1/docs/SchedulerConfiguration.md | 21 +- .../v1/docs/SchedulerConfigurationResponse.md | 16 +- .../docs/SchedulerSetConfigurationResponse.md | 10 +- clients/java/v1/docs/SearchApi.md | 76 +- clients/java/v1/docs/SearchRequest.md | 32 +- clients/java/v1/docs/SearchResponse.md | 18 +- clients/java/v1/docs/ServerHealth.md | 28 +- clients/java/v1/docs/Service.md | 39 +- clients/java/v1/docs/ServiceCheck.md | 52 +- clients/java/v1/docs/ServiceRegistration.md | 28 +- clients/java/v1/docs/SidecarTask.md | 26 +- clients/java/v1/docs/Spread.md | 10 +- clients/java/v1/docs/SpreadTarget.md | 8 +- clients/java/v1/docs/StatusApi.md | 72 +- clients/java/v1/docs/SystemApi.md | 52 +- clients/java/v1/docs/Task.md | 54 +- clients/java/v1/docs/TaskArtifact.md | 14 +- clients/java/v1/docs/TaskCSIPluginConfig.md | 12 +- clients/java/v1/docs/TaskDiff.md | 14 +- clients/java/v1/docs/TaskEvent.md | 54 +- clients/java/v1/docs/TaskGroup.md | 44 +- clients/java/v1/docs/TaskGroupDiff.md | 16 +- clients/java/v1/docs/TaskGroupScaleStatus.md | 16 +- clients/java/v1/docs/TaskGroupSummary.md | 18 +- clients/java/v1/docs/TaskHandle.md | 8 +- clients/java/v1/docs/TaskLifecycle.md | 8 +- clients/java/v1/docs/TaskState.md | 20 +- clients/java/v1/docs/Template.md | 28 +- clients/java/v1/docs/UpdateStrategy.md | 22 +- clients/java/v1/docs/Vault.md | 14 +- clients/java/v1/docs/VolumeMount.md | 12 +- clients/java/v1/docs/VolumeRequest.md | 20 +- clients/java/v1/docs/VolumesApi.md | 348 +- clients/java/v1/docs/WaitConfig.md | 8 +- clients/java/v1/gradle.properties | 8 +- .../java/v1/gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 59536 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- clients/java/v1/gradlew | 259 +- clients/java/v1/gradlew.bat | 2 +- clients/java/v1/pom.xml | 113 +- .../io/nomadproject/client/ApiCallback.java | 4 +- .../io/nomadproject/client/ApiClient.java | 195 +- .../io/nomadproject/client/ApiException.java | 77 +- .../io/nomadproject/client/ApiResponse.java | 21 +- .../java/io/nomadproject/client/JSON.java | 251 +- .../java/io/nomadproject/client/Pair.java | 4 - .../client/ProgressResponseBody.java | 2 - .../client/ServerConfiguration.java | 4 +- .../io/nomadproject/client/api/AclApi.java | 247 +- .../client/api/AllocationsApi.java | 95 +- .../client/api/DeploymentsApi.java | 171 +- .../client/api/EnterpriseApi.java | 114 +- .../client/api/EvaluationsApi.java | 76 +- .../io/nomadproject/client/api/JobsApi.java | 418 +- .../nomadproject/client/api/MetricsApi.java | 38 +- .../client/api/NamespacesApi.java | 114 +- .../io/nomadproject/client/api/NodesApi.java | 133 +- .../nomadproject/client/api/OperatorApi.java | 152 +- .../nomadproject/client/api/PluginsApi.java | 57 +- .../nomadproject/client/api/RegionsApi.java | 38 +- .../nomadproject/client/api/ScalingApi.java | 57 +- .../io/nomadproject/client/api/SearchApi.java | 57 +- .../io/nomadproject/client/api/StatusApi.java | 57 +- .../io/nomadproject/client/api/SystemApi.java | 57 +- .../nomadproject/client/api/VolumesApi.java | 228 +- .../nomadproject/client/auth/ApiKeyAuth.java | 5 +- .../client/auth/Authentication.java | 8 +- .../client/auth/HttpBasicAuth.java | 5 +- .../client/auth/HttpBearerAuth.java | 7 +- .../nomadproject/client/models/ACLPolicy.java | 121 + .../client/models/ACLPolicyListStub.java | 117 + .../nomadproject/client/models/ACLToken.java | 148 +- .../client/models/ACLTokenListStub.java | 144 +- .../client/models/AbstractOpenApiSchema.java | 149 + .../nomadproject/client/models/Affinity.java | 120 + .../client/models/AllocDeploymentStatus.java | 125 +- .../client/models/AllocStopResponse.java | 112 + .../client/models/AllocatedCpuResources.java | 108 + .../models/AllocatedDeviceResource.java | 126 +- .../models/AllocatedMemoryResources.java | 109 + .../client/models/AllocatedResources.java | 127 +- .../models/AllocatedSharedResources.java | 138 +- .../client/models/AllocatedTaskResources.java | 159 +- .../client/models/Allocation.java | 243 +- .../client/models/AllocationListStub.java | 209 +- .../client/models/AllocationMetric.java | 155 +- .../nomadproject/client/models/Attribute.java | 118 + .../client/models/AutopilotConfiguration.java | 123 + .../client/models/CSIControllerInfo.java | 119 + .../nomadproject/client/models/CSIInfo.java | 147 +- .../client/models/CSIMountOptions.java | 118 +- .../client/models/CSINodeInfo.java | 133 + .../nomadproject/client/models/CSIPlugin.java | 147 +- .../client/models/CSIPluginListStub.java | 122 + .../client/models/CSISnapshot.java | 136 +- .../models/CSISnapshotCreateRequest.java | 134 +- .../models/CSISnapshotCreateResponse.java | 130 +- .../models/CSISnapshotListResponse.java | 130 +- .../client/models/CSITopology.java | 110 +- .../client/models/CSITopologyRequest.java | 137 +- .../nomadproject/client/models/CSIVolume.java | 247 +- .../client/models/CSIVolumeCapability.java | 115 + .../client/models/CSIVolumeCreateRequest.java | 134 +- .../client/models/CSIVolumeExternalStub.java | 135 +- .../models/CSIVolumeListExternalResponse.java | 126 +- .../client/models/CSIVolumeListStub.java | 177 +- .../models/CSIVolumeRegisterRequest.java | 134 +- .../client/models/CheckRestart.java | 110 + .../client/models/Constraint.java | 119 + .../io/nomadproject/client/models/Consul.java | 111 + .../client/models/ConsulConnect.java | 135 + .../client/models/ConsulExposeConfig.java | 122 +- .../client/models/ConsulExposePath.java | 120 + .../client/models/ConsulGateway.java | 135 + .../models/ConsulGatewayBindAddress.java | 116 + .../client/models/ConsulGatewayProxy.java | 120 +- .../client/models/ConsulGatewayTLSConfig.java | 110 +- .../models/ConsulIngressConfigEntry.java | 139 +- .../client/models/ConsulIngressListener.java | 127 +- .../client/models/ConsulIngressService.java | 118 +- .../client/models/ConsulLinkedService.java | 127 + .../client/models/ConsulMeshGateway.java | 111 + .../client/models/ConsulProxy.java | 147 +- .../client/models/ConsulSidecarService.java | 136 +- .../models/ConsulTerminatingConfigEntry.java | 122 +- .../client/models/ConsulUpstream.java | 137 + .../nomadproject/client/models/DNSConfig.java | 128 +- .../client/models/Deployment.java | 137 +- .../models/DeploymentAllocHealthRequest.java | 137 +- .../client/models/DeploymentPauseRequest.java | 124 + .../models/DeploymentPromoteRequest.java | 131 +- .../client/models/DeploymentState.java | 137 +- .../models/DeploymentUnblockRequest.java | 123 + .../models/DeploymentUpdateResponse.java | 116 + .../client/models/DesiredTransition.java | 109 + .../client/models/DesiredUpdates.java | 115 + .../client/models/DispatchPayloadConfig.java | 133 +- .../client/models/DrainMetadata.java | 134 +- .../nomadproject/client/models/DrainSpec.java | 109 + .../client/models/DrainStrategy.java | 125 +- .../client/models/DriverInfo.java | 131 +- .../client/models/EphemeralDisk.java | 110 + .../client/models/EvalOptions.java | 108 + .../client/models/Evaluation.java | 209 +- .../client/models/EvaluationStub.java | 175 +- .../nomadproject/client/models/FieldDiff.java | 130 +- .../client/models/FuzzyMatch.java | 118 +- .../client/models/FuzzySearchRequest.java | 150 +- .../client/models/FuzzySearchResponse.java | 121 +- .../client/models/GaugeValue.java | 115 +- .../client/models/HostNetworkInfo.java | 123 + .../client/models/HostVolumeInfo.java | 112 + .../io/nomadproject/client/models/Job.java | 286 +- .../client/models/JobChildrenSummary.java | 110 + .../client/models/JobDeregisterResponse.java | 121 + .../nomadproject/client/models/JobDiff.java | 160 +- .../client/models/JobDispatchRequest.java | 115 +- .../client/models/JobDispatchResponse.java | 119 + .../client/models/JobEvaluateRequest.java | 140 + .../client/models/JobListStub.java | 167 +- .../client/models/JobPlanRequest.java | 138 + .../client/models/JobPlanResponse.java | 155 +- .../client/models/JobRegisterRequest.java | 141 + .../client/models/JobRegisterResponse.java | 125 + .../client/models/JobRevertRequest.java | 133 + .../client/models/JobScaleStatusResponse.java | 121 +- .../client/models/JobStabilityRequest.java | 125 + .../client/models/JobStabilityResponse.java | 108 + .../client/models/JobSummary.java | 137 +- .../client/models/JobValidateRequest.java | 136 + .../client/models/JobValidateResponse.java | 123 +- .../client/models/JobVersionsResponse.java | 145 +- .../client/models/JobsParseRequest.java | 113 + .../nomadproject/client/models/LogConfig.java | 109 + .../client/models/MetricsSummary.java | 171 +- .../client/models/MigrateStrategy.java | 114 + .../client/models/Multiregion.java | 127 +- .../client/models/MultiregionRegion.java | 122 +- .../client/models/MultiregionStrategy.java | 112 + .../nomadproject/client/models/Namespace.java | 141 +- .../client/models/NamespaceCapabilities.java | 121 +- .../client/models/NetworkResource.java | 175 +- .../io/nomadproject/client/models/Node.java | 229 +- .../client/models/NodeCpuResources.java | 116 +- .../client/models/NodeDevice.java | 133 + .../client/models/NodeDeviceLocality.java | 111 + .../client/models/NodeDeviceResource.java | 137 +- .../client/models/NodeDiskResources.java | 108 + .../models/NodeDrainUpdateResponse.java | 118 +- .../models/NodeEligibilityUpdateResponse.java | 118 +- .../nomadproject/client/models/NodeEvent.java | 134 +- .../client/models/NodeListStub.java | 179 +- .../client/models/NodeMemoryResources.java | 108 + .../client/models/NodePurgeResponse.java | 116 +- .../models/NodeReservedCpuResources.java | 108 + .../models/NodeReservedDiskResources.java | 108 + .../models/NodeReservedMemoryResources.java | 108 + .../models/NodeReservedNetworkResources.java | 111 + .../client/models/NodeReservedResources.java | 139 + .../client/models/NodeResources.java | 166 +- .../client/models/NodeScoreMeta.java | 115 +- .../client/models/NodeUpdateDrainRequest.java | 132 +- .../models/NodeUpdateEligibilityRequest.java | 115 + .../client/models/ObjectDiff.java | 145 +- .../client/models/OneTimeToken.java | 132 +- .../models/OneTimeTokenExchangeRequest.java | 111 + .../client/models/OperatorHealthReply.java | 124 +- .../client/models/ParameterizedJobConfig.java | 125 +- .../client/models/PeriodicConfig.java | 121 + .../client/models/PeriodicForceResponse.java | 113 + .../client/models/PlanAnnotations.java | 125 +- .../client/models/PointValue.java | 118 +- .../io/nomadproject/client/models/Port.java | 117 + .../client/models/PortMapping.java | 117 + .../client/models/PreemptionConfig.java | 111 + .../client/models/QuotaLimit.java | 129 + .../nomadproject/client/models/QuotaSpec.java | 132 +- .../client/models/RaftConfiguration.java | 123 +- .../client/models/RaftServer.java | 125 + .../client/models/RequestedDevice.java | 142 +- .../client/models/RescheduleEvent.java | 116 + .../client/models/ReschedulePolicy.java | 116 + .../client/models/RescheduleTracker.java | 122 +- .../nomadproject/client/models/Resources.java | 143 +- .../client/models/RestartPolicy.java | 114 + .../client/models/SampledValue.java | 121 +- .../client/models/ScalingEvent.java | 123 +- .../client/models/ScalingPolicy.java | 130 +- .../client/models/ScalingPolicyListStub.java | 121 +- .../client/models/ScalingRequest.java | 132 +- .../client/models/SchedulerConfiguration.java | 132 + .../SchedulerConfigurationResponse.java | 132 + .../SchedulerSetConfigurationResponse.java | 110 + .../client/models/SearchRequest.java | 146 +- .../client/models/SearchResponse.java | 121 +- .../client/models/ServerHealth.java | 148 +- .../nomadproject/client/models/Service.java | 193 +- .../client/models/ServiceCheck.java | 197 +- .../client/models/ServiceRegistration.java | 149 +- .../client/models/SidecarTask.java | 156 +- .../io/nomadproject/client/models/Spread.java | 127 +- .../client/models/SpreadTarget.java | 112 + .../io/nomadproject/client/models/Task.java | 291 +- .../client/models/TaskArtifact.java | 125 +- .../client/models/TaskCSIPluginConfig.java | 119 + .../nomadproject/client/models/TaskDiff.java | 152 +- .../nomadproject/client/models/TaskEvent.java | 182 +- .../nomadproject/client/models/TaskGroup.java | 258 +- .../client/models/TaskGroupDiff.java | 163 +- .../client/models/TaskGroupScaleStatus.java | 127 +- .../client/models/TaskGroupSummary.java | 114 + .../client/models/TaskHandle.java | 109 + .../client/models/TaskLifecycle.java | 112 + .../nomadproject/client/models/TaskState.java | 150 +- .../nomadproject/client/models/Template.java | 147 + .../client/models/UpdateStrategy.java | 119 + .../io/nomadproject/client/models/Vault.java | 127 +- .../client/models/VolumeMount.java | 120 + .../client/models/VolumeRequest.java | 146 + .../client/models/WaitConfig.java | 109 + .../nomadproject/client/api/AclApiTest.java | 127 +- .../client/api/AllocationsApiTest.java | 47 +- .../client/api/DeploymentsApiTest.java | 87 +- .../client/api/EnterpriseApiTest.java | 57 +- .../client/api/EvaluationsApiTest.java | 37 +- .../nomadproject/client/api/JobsApiTest.java | 217 +- .../client/api/MetricsApiTest.java | 17 +- .../client/api/NamespacesApiTest.java | 57 +- .../nomadproject/client/api/NodesApiTest.java | 67 +- .../client/api/OperatorApiTest.java | 77 +- .../client/api/PluginsApiTest.java | 27 +- .../client/api/RegionsApiTest.java | 17 +- .../client/api/ScalingApiTest.java | 27 +- .../client/api/SearchApiTest.java | 27 +- .../client/api/StatusApiTest.java | 27 +- .../client/api/SystemApiTest.java | 27 +- .../client/api/VolumesApiTest.java | 117 +- .../client/models/ACLPolicyListStubTest.java | 5 +- .../client/models/AffinityTest.java | 5 +- .../models/AllocDeploymentStatusTest.java | 8 +- .../client/models/AllocStopResponseTest.java | 5 +- .../models/AllocatedCpuResourcesTest.java | 5 +- .../models/AllocatedDeviceResourceTest.java | 5 +- .../models/AllocatedMemoryResourcesTest.java | 5 +- .../client/models/AllocatedResourcesTest.java | 6 +- .../models/AllocatedSharedResourcesTest.java | 5 +- .../models/AllocatedTaskResourcesTest.java | 6 +- .../client/models/AllocationListStubTest.java | 6 +- .../client/models/AllocationMetricTest.java | 5 +- .../client/models/AllocationTest.java | 6 +- .../client/models/AttributeTest.java | 5 +- .../models/AutopilotConfigurationTest.java | 5 +- .../client/models/CSIControllerInfoTest.java | 5 +- .../client/models/CSIInfoTest.java | 8 +- .../client/models/CSIMountOptionsTest.java | 5 +- .../client/models/CSINodeInfoTest.java | 6 +- .../client/models/CSIPluginListStubTest.java | 5 +- .../client/models/CSIPluginTest.java | 5 +- .../models/CSISnapshotCreateRequestTest.java | 5 +- .../models/CSISnapshotCreateResponseTest.java | 5 +- .../models/CSISnapshotListResponseTest.java | 5 +- .../client/models/CSISnapshotTest.java | 5 +- .../client/models/CSITopologyRequestTest.java | 5 +- .../client/models/CSITopologyTest.java | 5 +- .../models/CSIVolumeCapabilityTest.java | 5 +- .../models/CSIVolumeCreateRequestTest.java | 5 +- .../models/CSIVolumeExternalStubTest.java | 5 +- .../CSIVolumeListExternalResponseTest.java | 5 +- .../client/models/CSIVolumeListStubTest.java | 8 +- .../models/CSIVolumeRegisterRequestTest.java | 5 +- .../client/models/CSIVolumeTest.java | 8 +- .../client/models/CheckRestartTest.java | 5 +- .../client/models/ConstraintTest.java | 5 +- .../client/models/ConsulConnectTest.java | 6 +- .../client/models/ConsulExposeConfigTest.java | 5 +- .../client/models/ConsulExposePathTest.java | 5 +- .../models/ConsulGatewayBindAddressTest.java | 5 +- .../client/models/ConsulGatewayProxyTest.java | 5 +- .../models/ConsulGatewayTLSConfigTest.java | 2 + .../client/models/ConsulGatewayTest.java | 6 +- .../models/ConsulIngressConfigEntryTest.java | 6 +- .../models/ConsulIngressListenerTest.java | 5 +- .../models/ConsulIngressServiceTest.java | 5 +- .../models/ConsulLinkedServiceTest.java | 5 +- .../client/models/ConsulMeshGatewayTest.java | 5 +- .../client/models/ConsulProxyTest.java | 6 +- .../models/ConsulSidecarServiceTest.java | 6 +- .../ConsulTerminatingConfigEntryTest.java | 5 +- .../client/models/ConsulTest.java | 5 +- .../client/models/ConsulUpstreamTest.java | 6 +- .../client/models/DNSConfigTest.java | 5 +- .../DeploymentAllocHealthRequestTest.java | 5 +- .../models/DeploymentPauseRequestTest.java | 5 +- .../models/DeploymentPromoteRequestTest.java | 5 +- .../client/models/DeploymentStateTest.java | 8 +- .../client/models/DeploymentTest.java | 5 +- .../models/DeploymentUnblockRequestTest.java | 5 +- .../models/DeploymentUpdateResponseTest.java | 5 +- .../client/models/DesiredTransitionTest.java | 5 +- .../client/models/DesiredUpdatesTest.java | 5 +- .../models/DispatchPayloadConfigTest.java | 11 +- .../client/models/DrainMetadataTest.java | 8 +- .../client/models/DrainSpecTest.java | 5 +- .../client/models/DrainStrategyTest.java | 8 +- .../client/models/DriverInfoTest.java | 8 +- .../client/models/EphemeralDiskTest.java | 5 +- .../client/models/EvalOptionsTest.java | 5 +- .../client/models/EvaluationStubTest.java | 8 +- .../client/models/EvaluationTest.java | 8 +- .../client/models/FieldDiffTest.java | 5 +- .../client/models/FuzzyMatchTest.java | 5 +- .../client/models/FuzzySearchRequestTest.java | 5 +- .../models/FuzzySearchResponseTest.java | 5 +- .../client/models/GaugeValueTest.java | 5 +- .../client/models/HostNetworkInfoTest.java | 5 +- .../client/models/HostVolumeInfoTest.java | 5 +- .../client/models/JobChildrenSummaryTest.java | 5 +- .../models/JobDeregisterResponseTest.java | 5 +- .../client/models/JobDiffTest.java | 5 +- .../client/models/JobDispatchRequestTest.java | 5 +- .../models/JobDispatchResponseTest.java | 5 +- .../client/models/JobEvaluateRequestTest.java | 6 +- .../client/models/JobListStubTest.java | 6 +- .../client/models/JobPlanRequestTest.java | 6 +- .../client/models/JobPlanResponseTest.java | 8 +- .../client/models/JobRegisterRequestTest.java | 6 +- .../models/JobRegisterResponseTest.java | 5 +- .../client/models/JobRevertRequestTest.java | 5 +- .../models/JobScaleStatusResponseTest.java | 5 +- .../models/JobStabilityRequestTest.java | 5 +- .../models/JobStabilityResponseTest.java | 5 +- .../client/models/JobSummaryTest.java | 6 +- .../nomadproject/client/models/JobTest.java | 6 +- .../client/models/JobValidateRequestTest.java | 6 +- .../models/JobValidateResponseTest.java | 5 +- .../models/JobVersionsResponseTest.java | 5 +- .../client/models/JobsParseRequestTest.java | 5 +- .../client/models/LogConfigTest.java | 5 +- .../client/models/MetricsSummaryTest.java | 5 +- .../client/models/MigrateStrategyTest.java | 5 +- .../client/models/MultiregionRegionTest.java | 5 +- .../models/MultiregionStrategyTest.java | 5 +- .../client/models/MultiregionTest.java | 5 +- .../models/NamespaceCapabilitiesTest.java | 5 +- .../client/models/NamespaceTest.java | 6 +- .../client/models/NetworkResourceTest.java | 6 +- .../client/models/NodeCpuResourcesTest.java | 5 +- .../client/models/NodeDeviceLocalityTest.java | 5 +- .../client/models/NodeDeviceResourceTest.java | 5 +- .../client/models/NodeDeviceTest.java | 6 +- .../client/models/NodeDiskResourcesTest.java | 5 +- .../models/NodeDrainUpdateResponseTest.java | 5 +- .../NodeEligibilityUpdateResponseTest.java | 5 +- .../client/models/NodeEventTest.java | 8 +- .../client/models/NodeListStubTest.java | 6 +- .../models/NodeMemoryResourcesTest.java | 5 +- .../client/models/NodePurgeResponseTest.java | 5 +- .../models/NodeReservedCpuResourcesTest.java | 5 +- .../models/NodeReservedDiskResourcesTest.java | 5 +- .../NodeReservedMemoryResourcesTest.java | 5 +- .../NodeReservedNetworkResourcesTest.java | 5 +- .../models/NodeReservedResourcesTest.java | 6 +- .../client/models/NodeResourcesTest.java | 6 +- .../client/models/NodeScoreMetaTest.java | 5 +- .../nomadproject/client/models/NodeTest.java | 6 +- .../models/NodeUpdateDrainRequestTest.java | 6 +- .../NodeUpdateEligibilityRequestTest.java | 5 +- .../client/models/ObjectDiffTest.java | 5 +- .../OneTimeTokenExchangeRequestTest.java | 5 +- .../client/models/OneTimeTokenTest.java | 8 +- .../models/OperatorHealthReplyTest.java | 5 +- .../models/ParameterizedJobConfigTest.java | 5 +- .../client/models/PeriodicConfigTest.java | 5 +- .../models/PeriodicForceResponseTest.java | 5 +- .../client/models/PlanAnnotationsTest.java | 5 +- .../client/models/PointValueTest.java | 5 +- .../client/models/PortMappingTest.java | 5 +- .../nomadproject/client/models/PortTest.java | 5 +- .../client/models/PreemptionConfigTest.java | 5 +- .../client/models/QuotaLimitTest.java | 6 +- .../client/models/QuotaSpecTest.java | 5 +- .../client/models/RaftConfigurationTest.java | 5 +- .../client/models/RaftServerTest.java | 5 +- .../client/models/RequestedDeviceTest.java | 5 +- .../client/models/RescheduleEventTest.java | 5 +- .../client/models/ReschedulePolicyTest.java | 5 +- .../client/models/RescheduleTrackerTest.java | 5 +- .../client/models/ResourcesTest.java | 5 +- .../client/models/RestartPolicyTest.java | 5 +- .../client/models/SampledValueTest.java | 5 +- .../client/models/ScalingEventTest.java | 5 +- .../models/ScalingPolicyListStubTest.java | 5 +- .../client/models/ScalingPolicyTest.java | 5 +- .../client/models/ScalingRequestTest.java | 5 +- .../SchedulerConfigurationResponseTest.java | 6 +- .../models/SchedulerConfigurationTest.java | 6 +- ...SchedulerSetConfigurationResponseTest.java | 5 +- .../client/models/SearchRequestTest.java | 5 +- .../client/models/SearchResponseTest.java | 5 +- .../client/models/ServerHealthTest.java | 8 +- .../client/models/ServiceCheckTest.java | 6 +- .../models/ServiceRegistrationTest.java | 5 +- .../client/models/ServiceTest.java | 6 +- .../client/models/SidecarTaskTest.java | 6 +- .../client/models/SpreadTargetTest.java | 5 +- .../client/models/SpreadTest.java | 5 +- .../client/models/TaskArtifactTest.java | 5 +- .../models/TaskCSIPluginConfigTest.java | 5 +- .../client/models/TaskDiffTest.java | 5 +- .../client/models/TaskEventTest.java | 5 +- .../client/models/TaskGroupDiffTest.java | 5 +- .../models/TaskGroupScaleStatusTest.java | 5 +- .../client/models/TaskGroupSummaryTest.java | 5 +- .../client/models/TaskGroupTest.java | 6 +- .../client/models/TaskHandleTest.java | 5 +- .../client/models/TaskLifecycleTest.java | 5 +- .../client/models/TaskStateTest.java | 8 +- .../nomadproject/client/models/TaskTest.java | 6 +- .../client/models/TemplateTest.java | 5 +- .../client/models/UpdateStrategyTest.java | 5 +- .../nomadproject/client/models/VaultTest.java | 5 +- .../client/models/VolumeMountTest.java | 5 +- .../client/models/VolumeRequestTest.java | 6 +- .../client/models/WaitConfigTest.java | 5 +- .../javascript/v1/.openapi-generator/VERSION | 2 +- clients/javascript/v1/src/ApiClient.js | 11 +- .../v1/test/model/AllocStopResponse.spec.js | 2 +- .../test/model/AutopilotConfiguration.spec.js | 2 +- .../v1/test/model/CSIControllerInfo.spec.js | 2 +- .../javascript/v1/test/model/CSIInfo.spec.js | 2 +- .../v1/test/model/CSINodeInfo.spec.js | 2 +- .../v1/test/model/CSIPlugin.spec.js | 2 +- .../v1/test/model/CSIPluginListStub.spec.js | 2 +- .../v1/test/model/CSITopologyRequest.spec.js | 2 +- .../DeploymentAllocHealthRequest.spec.js | 2 +- .../test/model/DeploymentPauseRequest.spec.js | 2 +- .../model/DeploymentPromoteRequest.spec.js | 2 +- .../model/DeploymentUnblockRequest.spec.js | 2 +- .../model/DeploymentUpdateResponse.spec.js | 2 +- .../v1/test/model/EvaluationStub.spec.js | 2 +- .../v1/test/model/HostNetworkInfo.spec.js | 2 +- .../test/model/NamespaceCapabilities.spec.js | 2 +- .../v1/test/model/OneTimeToken.spec.js | 2 +- .../model/OneTimeTokenExchangeRequest.spec.js | 2 +- .../v1/test/model/OperatorHealthReply.spec.js | 2 +- .../v1/test/model/PreemptionConfig.spec.js | 2 +- .../v1/test/model/RaftConfiguration.spec.js | 2 +- .../v1/test/model/RaftServer.spec.js | 2 +- .../test/model/ScalingPolicyListStub.spec.js | 2 +- .../test/model/SchedulerConfiguration.spec.js | 2 +- .../SchedulerConfigurationResponse.spec.js | 2 +- .../SchedulerSetConfigurationResponse.spec.js | 2 +- .../v1/test/model/ServerHealth.spec.js | 2 +- .../v1/test/model/ServiceRegistration.spec.js | 2 +- .../v1/test/model/WaitConfig.spec.js | 2 +- clients/python/v1/.openapi-generator/VERSION | 2 +- clients/python/v1/README.md | 10 +- clients/python/v1/docs/ACLApi.md | 24 + clients/python/v1/docs/ACLToken.md | 2 +- clients/python/v1/docs/ACLTokenListStub.md | 2 +- .../python/v1/docs/AllocDeploymentStatus.md | 2 +- clients/python/v1/docs/AllocationsApi.md | 8 + clients/python/v1/docs/CSIInfo.md | 2 +- clients/python/v1/docs/CSIVolume.md | 2 +- clients/python/v1/docs/CSIVolumeListStub.md | 2 +- clients/python/v1/docs/DeploymentState.md | 2 +- clients/python/v1/docs/DeploymentsApi.md | 16 + clients/python/v1/docs/DrainMetadata.md | 4 +- clients/python/v1/docs/DrainStrategy.md | 4 +- clients/python/v1/docs/DriverInfo.md | 2 +- clients/python/v1/docs/EnterpriseApi.md | 10 + clients/python/v1/docs/Evaluation.md | 2 +- clients/python/v1/docs/EvaluationStub.md | 2 +- clients/python/v1/docs/EvaluationsApi.md | 6 + clients/python/v1/docs/Int8.md | 1 - clients/python/v1/docs/JobPlanResponse.md | 2 +- clients/python/v1/docs/JobsApi.md | 42 + clients/python/v1/docs/MetricsApi.md | 2 + clients/python/v1/docs/NamespacesApi.md | 10 + clients/python/v1/docs/NodeEvent.md | 2 +- clients/python/v1/docs/NodesApi.md | 12 + clients/python/v1/docs/OneTimeToken.md | 2 +- clients/python/v1/docs/OperatorApi.md | 14 + clients/python/v1/docs/PluginsApi.md | 4 + clients/python/v1/docs/RegionsApi.md | 2 + clients/python/v1/docs/ScalingApi.md | 4 + clients/python/v1/docs/SearchApi.md | 4 + clients/python/v1/docs/ServerHealth.md | 2 +- clients/python/v1/docs/StatusApi.md | 4 + clients/python/v1/docs/SystemApi.md | 4 + clients/python/v1/docs/TaskState.md | 6 +- clients/python/v1/docs/Uint.md | 1 - clients/python/v1/docs/Uint16.md | 1 - clients/python/v1/docs/Uint64.md | 1 - clients/python/v1/docs/Uint8.md | 1 - clients/python/v1/docs/VolumesApi.md | 22 + clients/python/v1/nomad_client/api/acl_api.py | 1974 ++-- .../v1/nomad_client/api/allocations_api.py | 687 +- .../v1/nomad_client/api/deployments_api.py | 1345 ++- .../v1/nomad_client/api/enterprise_api.py | 834 +- .../v1/nomad_client/api/evaluations_api.py | 504 +- .../python/v1/nomad_client/api/jobs_api.py | 3570 +++--- .../python/v1/nomad_client/api/metrics_api.py | 146 +- .../v1/nomad_client/api/namespaces_api.py | 823 +- .../python/v1/nomad_client/api/nodes_api.py | 1037 +- .../v1/nomad_client/api/operator_api.py | 1120 +- .../python/v1/nomad_client/api/plugins_api.py | 333 +- .../python/v1/nomad_client/api/regions_api.py | 144 +- .../python/v1/nomad_client/api/scaling_api.py | 333 +- .../python/v1/nomad_client/api/search_api.py | 345 +- .../python/v1/nomad_client/api/status_api.py | 323 +- .../python/v1/nomad_client/api/system_api.py | 303 +- .../python/v1/nomad_client/api/volumes_api.py | 1846 +-- clients/python/v1/nomad_client/api_client.py | 131 +- .../python/v1/nomad_client/apis/__init__.py | 2 +- .../python/v1/nomad_client/configuration.py | 17 +- clients/python/v1/nomad_client/exceptions.py | 3 +- .../python/v1/nomad_client/model/__init__.py | 2 +- .../v1/nomad_client/model/acl_policy.py | 46 +- .../model/acl_policy_list_stub.py | 46 +- .../python/v1/nomad_client/model/acl_token.py | 52 +- .../nomad_client/model/acl_token_list_stub.py | 52 +- .../python/v1/nomad_client/model/affinity.py | 46 +- .../model/alloc_deployment_status.py | 52 +- .../nomad_client/model/alloc_stop_response.py | 46 +- .../model/allocated_cpu_resources.py | 46 +- .../model/allocated_device_resource.py | 46 +- .../model/allocated_memory_resources.py | 46 +- .../nomad_client/model/allocated_resources.py | 46 +- .../model/allocated_shared_resources.py | 46 +- .../model/allocated_task_resources.py | 46 +- .../v1/nomad_client/model/allocation.py | 46 +- .../model/allocation_list_stub.py | 46 +- .../nomad_client/model/allocation_metric.py | 46 +- .../python/v1/nomad_client/model/attribute.py | 46 +- .../model/autopilot_configuration.py | 46 +- .../v1/nomad_client/model/check_restart.py | 46 +- .../v1/nomad_client/model/constraint.py | 46 +- .../python/v1/nomad_client/model/consul.py | 46 +- .../v1/nomad_client/model/consul_connect.py | 46 +- .../model/consul_expose_config.py | 46 +- .../nomad_client/model/consul_expose_path.py | 46 +- .../v1/nomad_client/model/consul_gateway.py | 44 +- .../model/consul_gateway_bind_address.py | 46 +- .../model/consul_gateway_proxy.py | 46 +- .../model/consul_gateway_tls_config.py | 46 +- .../model/consul_ingress_config_entry.py | 46 +- .../model/consul_ingress_listener.py | 46 +- .../model/consul_ingress_service.py | 46 +- .../model/consul_linked_service.py | 46 +- .../nomad_client/model/consul_mesh_gateway.py | 46 +- .../v1/nomad_client/model/consul_proxy.py | 46 +- .../model/consul_sidecar_service.py | 46 +- .../model/consul_terminating_config_entry.py | 46 +- .../v1/nomad_client/model/consul_upstream.py | 46 +- .../nomad_client/model/csi_controller_info.py | 46 +- .../python/v1/nomad_client/model/csi_info.py | 52 +- .../nomad_client/model/csi_mount_options.py | 46 +- .../v1/nomad_client/model/csi_node_info.py | 46 +- .../v1/nomad_client/model/csi_plugin.py | 46 +- .../model/csi_plugin_list_stub.py | 46 +- .../v1/nomad_client/model/csi_secrets.py | 44 +- .../v1/nomad_client/model/csi_snapshot.py | 46 +- .../model/csi_snapshot_create_request.py | 46 +- .../model/csi_snapshot_create_response.py | 46 +- .../model/csi_snapshot_list_response.py | 46 +- .../v1/nomad_client/model/csi_topology.py | 46 +- .../model/csi_topology_request.py | 46 +- .../v1/nomad_client/model/csi_volume.py | 52 +- .../model/csi_volume_capability.py | 46 +- .../model/csi_volume_create_request.py | 46 +- .../model/csi_volume_external_stub.py | 46 +- .../csi_volume_list_external_response.py | 46 +- .../model/csi_volume_list_stub.py | 52 +- .../model/csi_volume_register_request.py | 46 +- .../v1/nomad_client/model/deployment.py | 46 +- .../model/deployment_alloc_health_request.py | 46 +- .../model/deployment_pause_request.py | 46 +- .../model/deployment_promote_request.py | 46 +- .../v1/nomad_client/model/deployment_state.py | 52 +- .../model/deployment_unblock_request.py | 46 +- .../model/deployment_update_response.py | 46 +- .../nomad_client/model/desired_transition.py | 44 +- .../v1/nomad_client/model/desired_updates.py | 46 +- .../model/dispatch_payload_config.py | 46 +- .../v1/nomad_client/model/dns_config.py | 46 +- .../v1/nomad_client/model/drain_metadata.py | 58 +- .../v1/nomad_client/model/drain_spec.py | 46 +- .../v1/nomad_client/model/drain_strategy.py | 58 +- .../v1/nomad_client/model/driver_info.py | 52 +- .../v1/nomad_client/model/ephemeral_disk.py | 44 +- .../v1/nomad_client/model/eval_options.py | 46 +- .../v1/nomad_client/model/evaluation.py | 52 +- .../v1/nomad_client/model/evaluation_stub.py | 52 +- .../v1/nomad_client/model/field_diff.py | 46 +- .../v1/nomad_client/model/fuzzy_match.py | 46 +- .../model/fuzzy_search_request.py | 46 +- .../model/fuzzy_search_response.py | 46 +- .../v1/nomad_client/model/gauge_value.py | 46 +- .../nomad_client/model/host_network_info.py | 46 +- .../v1/nomad_client/model/host_volume_info.py | 46 +- clients/python/v1/nomad_client/model/int8.py | 50 +- clients/python/v1/nomad_client/model/job.py | 46 +- .../model/job_children_summary.py | 46 +- .../model/job_deregister_response.py | 46 +- .../python/v1/nomad_client/model/job_diff.py | 46 +- .../model/job_dispatch_request.py | 46 +- .../model/job_dispatch_response.py | 46 +- .../model/job_evaluate_request.py | 46 +- .../v1/nomad_client/model/job_list_stub.py | 46 +- .../v1/nomad_client/model/job_plan_request.py | 46 +- .../nomad_client/model/job_plan_response.py | 52 +- .../model/job_register_request.py | 46 +- .../model/job_register_response.py | 46 +- .../nomad_client/model/job_revert_request.py | 46 +- .../model/job_scale_status_response.py | 46 +- .../model/job_stability_request.py | 46 +- .../model/job_stability_response.py | 46 +- .../v1/nomad_client/model/job_summary.py | 46 +- .../model/job_validate_request.py | 46 +- .../model/job_validate_response.py | 46 +- .../model/job_versions_response.py | 46 +- .../nomad_client/model/jobs_parse_request.py | 46 +- .../v1/nomad_client/model/log_config.py | 44 +- .../v1/nomad_client/model/metrics_summary.py | 46 +- .../v1/nomad_client/model/migrate_strategy.py | 44 +- .../v1/nomad_client/model/multiregion.py | 46 +- .../nomad_client/model/multiregion_region.py | 46 +- .../model/multiregion_strategy.py | 44 +- .../python/v1/nomad_client/model/namespace.py | 46 +- .../model/namespace_capabilities.py | 46 +- .../v1/nomad_client/model/network_resource.py | 46 +- clients/python/v1/nomad_client/model/node.py | 46 +- .../nomad_client/model/node_cpu_resources.py | 46 +- .../v1/nomad_client/model/node_device.py | 46 +- .../model/node_device_locality.py | 46 +- .../model/node_device_resource.py | 46 +- .../nomad_client/model/node_disk_resources.py | 46 +- .../model/node_drain_update_response.py | 46 +- .../model/node_eligibility_update_response.py | 46 +- .../v1/nomad_client/model/node_event.py | 52 +- .../v1/nomad_client/model/node_list_stub.py | 46 +- .../model/node_memory_resources.py | 46 +- .../nomad_client/model/node_purge_response.py | 46 +- .../model/node_reserved_cpu_resources.py | 46 +- .../model/node_reserved_disk_resources.py | 46 +- .../model/node_reserved_memory_resources.py | 46 +- .../model/node_reserved_network_resources.py | 46 +- .../model/node_reserved_resources.py | 46 +- .../v1/nomad_client/model/node_resources.py | 46 +- .../v1/nomad_client/model/node_score_meta.py | 46 +- .../model/node_update_drain_request.py | 46 +- .../model/node_update_eligibility_request.py | 46 +- .../v1/nomad_client/model/object_diff.py | 46 +- .../v1/nomad_client/model/one_time_token.py | 52 +- .../model/one_time_token_exchange_request.py | 46 +- .../model/operator_health_reply.py | 46 +- .../model/parameterized_job_config.py | 46 +- .../v1/nomad_client/model/periodic_config.py | 44 +- .../model/periodic_force_response.py | 46 +- .../v1/nomad_client/model/plan_annotations.py | 46 +- .../v1/nomad_client/model/point_value.py | 46 +- clients/python/v1/nomad_client/model/port.py | 46 +- .../v1/nomad_client/model/port_mapping.py | 46 +- .../nomad_client/model/preemption_config.py | 46 +- .../v1/nomad_client/model/quota_limit.py | 46 +- .../v1/nomad_client/model/quota_spec.py | 46 +- .../nomad_client/model/raft_configuration.py | 46 +- .../v1/nomad_client/model/raft_server.py | 46 +- .../v1/nomad_client/model/requested_device.py | 46 +- .../v1/nomad_client/model/reschedule_event.py | 46 +- .../nomad_client/model/reschedule_policy.py | 44 +- .../nomad_client/model/reschedule_tracker.py | 46 +- .../python/v1/nomad_client/model/resources.py | 46 +- .../v1/nomad_client/model/restart_policy.py | 44 +- .../v1/nomad_client/model/sampled_value.py | 46 +- .../v1/nomad_client/model/scaling_event.py | 46 +- .../v1/nomad_client/model/scaling_policy.py | 46 +- .../model/scaling_policy_list_stub.py | 46 +- .../v1/nomad_client/model/scaling_request.py | 46 +- .../model/scheduler_configuration.py | 46 +- .../model/scheduler_configuration_response.py | 46 +- .../scheduler_set_configuration_response.py | 46 +- .../v1/nomad_client/model/search_request.py | 46 +- .../v1/nomad_client/model/search_response.py | 46 +- .../v1/nomad_client/model/server_health.py | 52 +- .../python/v1/nomad_client/model/service.py | 46 +- .../v1/nomad_client/model/service_check.py | 46 +- .../model/service_registration.py | 46 +- .../v1/nomad_client/model/sidecar_task.py | 46 +- .../python/v1/nomad_client/model/spread.py | 46 +- .../v1/nomad_client/model/spread_target.py | 46 +- clients/python/v1/nomad_client/model/task.py | 46 +- .../v1/nomad_client/model/task_artifact.py | 46 +- .../model/task_csi_plugin_config.py | 46 +- .../python/v1/nomad_client/model/task_diff.py | 46 +- .../v1/nomad_client/model/task_event.py | 46 +- .../v1/nomad_client/model/task_group.py | 46 +- .../v1/nomad_client/model/task_group_diff.py | 46 +- .../model/task_group_scale_status.py | 46 +- .../nomad_client/model/task_group_summary.py | 46 +- .../v1/nomad_client/model/task_handle.py | 46 +- .../v1/nomad_client/model/task_lifecycle.py | 46 +- .../v1/nomad_client/model/task_state.py | 64 +- .../python/v1/nomad_client/model/template.py | 44 +- clients/python/v1/nomad_client/model/uint.py | 50 +- .../python/v1/nomad_client/model/uint16.py | 50 +- .../python/v1/nomad_client/model/uint64.py | 50 +- clients/python/v1/nomad_client/model/uint8.py | 50 +- .../v1/nomad_client/model/update_strategy.py | 44 +- clients/python/v1/nomad_client/model/vault.py | 46 +- .../v1/nomad_client/model/volume_mount.py | 44 +- .../v1/nomad_client/model/volume_request.py | 46 +- .../v1/nomad_client/model/wait_config.py | 44 +- clients/python/v1/nomad_client/model_utils.py | 160 +- clients/python/v1/nomad_client/rest.py | 66 +- clients/ruby/v1/.openapi-generator/VERSION | 2 +- clients/ruby/v1/docs/ConsulGateway.md | 2 +- clients/ruby/v1/docs/ConsulGatewayProxy.md | 2 +- clients/ruby/v1/docs/ConsulProxy.md | 2 +- clients/ruby/v1/docs/EnterpriseApi.md | 8 +- clients/ruby/v1/docs/ScalingEvent.md | 2 +- clients/ruby/v1/docs/ScalingPolicy.md | 2 +- clients/ruby/v1/docs/ScalingRequest.md | 2 +- clients/ruby/v1/docs/SidecarTask.md | 2 +- clients/ruby/v1/docs/Task.md | 2 +- clients/ruby/v1/lib/nomad_client.rb | 2 +- .../ruby/v1/lib/nomad_client/api/acl_api.rb | 29 +- .../lib/nomad_client/api/allocations_api.rb | 2 +- .../lib/nomad_client/api/deployments_api.rb | 38 +- .../v1/lib/nomad_client/api/enterprise_api.rb | 26 +- .../lib/nomad_client/api/evaluations_api.rb | 2 +- .../ruby/v1/lib/nomad_client/api/jobs_api.rb | 92 +- .../v1/lib/nomad_client/api/metrics_api.rb | 2 +- .../v1/lib/nomad_client/api/namespaces_api.rb | 11 +- .../ruby/v1/lib/nomad_client/api/nodes_api.rb | 20 +- .../v1/lib/nomad_client/api/operator_api.rb | 20 +- .../v1/lib/nomad_client/api/plugins_api.rb | 2 +- .../v1/lib/nomad_client/api/regions_api.rb | 2 +- .../v1/lib/nomad_client/api/scaling_api.rb | 2 +- .../v1/lib/nomad_client/api/search_api.rb | 20 +- .../v1/lib/nomad_client/api/status_api.rb | 2 +- .../v1/lib/nomad_client/api/system_api.rb | 2 +- .../v1/lib/nomad_client/api/volumes_api.rb | 38 +- .../ruby/v1/lib/nomad_client/api_client.rb | 12 +- clients/ruby/v1/lib/nomad_client/api_error.rb | 2 +- .../ruby/v1/lib/nomad_client/configuration.rb | 8 +- .../v1/lib/nomad_client/models/acl_policy.rb | 3 +- .../models/acl_policy_list_stub.rb | 3 +- .../v1/lib/nomad_client/models/acl_token.rb | 4 +- .../models/acl_token_list_stub.rb | 4 +- .../v1/lib/nomad_client/models/affinity.rb | 3 +- .../models/alloc_deployment_status.rb | 4 +- .../models/alloc_stop_response.rb | 3 +- .../models/allocated_cpu_resources.rb | 3 +- .../models/allocated_device_resource.rb | 3 +- .../models/allocated_memory_resources.rb | 3 +- .../models/allocated_resources.rb | 4 +- .../models/allocated_shared_resources.rb | 3 +- .../models/allocated_task_resources.rb | 5 +- .../v1/lib/nomad_client/models/allocation.rb | 9 +- .../models/allocation_list_stub.rb | 6 +- .../nomad_client/models/allocation_metric.rb | 3 +- .../v1/lib/nomad_client/models/attribute.rb | 3 +- .../models/autopilot_configuration.rb | 3 +- .../lib/nomad_client/models/check_restart.rb | 3 +- .../v1/lib/nomad_client/models/constraint.rb | 3 +- .../ruby/v1/lib/nomad_client/models/consul.rb | 3 +- .../lib/nomad_client/models/consul_connect.rb | 5 +- .../models/consul_expose_config.rb | 3 +- .../nomad_client/models/consul_expose_path.rb | 3 +- .../lib/nomad_client/models/consul_gateway.rb | 8 +- .../models/consul_gateway_bind_address.rb | 3 +- .../models/consul_gateway_proxy.rb | 5 +- .../models/consul_gateway_tls_config.rb | 3 +- .../models/consul_ingress_config_entry.rb | 4 +- .../models/consul_ingress_listener.rb | 3 +- .../models/consul_ingress_service.rb | 3 +- .../models/consul_linked_service.rb | 3 +- .../models/consul_mesh_gateway.rb | 3 +- .../lib/nomad_client/models/consul_proxy.rb | 6 +- .../models/consul_sidecar_service.rb | 4 +- .../models/consul_terminating_config_entry.rb | 3 +- .../nomad_client/models/consul_upstream.rb | 4 +- .../models/csi_controller_info.rb | 3 +- .../v1/lib/nomad_client/models/csi_info.rb | 6 +- .../nomad_client/models/csi_mount_options.rb | 3 +- .../lib/nomad_client/models/csi_node_info.rb | 4 +- .../v1/lib/nomad_client/models/csi_plugin.rb | 3 +- .../models/csi_plugin_list_stub.rb | 3 +- .../lib/nomad_client/models/csi_snapshot.rb | 3 +- .../models/csi_snapshot_create_request.rb | 3 +- .../models/csi_snapshot_create_response.rb | 3 +- .../models/csi_snapshot_list_response.rb | 3 +- .../lib/nomad_client/models/csi_topology.rb | 3 +- .../models/csi_topology_request.rb | 3 +- .../v1/lib/nomad_client/models/csi_volume.rb | 6 +- .../models/csi_volume_capability.rb | 3 +- .../models/csi_volume_create_request.rb | 3 +- .../models/csi_volume_external_stub.rb | 3 +- .../csi_volume_list_external_response.rb | 3 +- .../models/csi_volume_list_stub.rb | 4 +- .../models/csi_volume_register_request.rb | 3 +- .../v1/lib/nomad_client/models/deployment.rb | 3 +- .../models/deployment_alloc_health_request.rb | 3 +- .../models/deployment_pause_request.rb | 3 +- .../models/deployment_promote_request.rb | 3 +- .../nomad_client/models/deployment_state.rb | 4 +- .../models/deployment_unblock_request.rb | 3 +- .../models/deployment_update_response.rb | 3 +- .../nomad_client/models/desired_transition.rb | 3 +- .../nomad_client/models/desired_updates.rb | 3 +- .../models/dispatch_payload_config.rb | 3 +- .../v1/lib/nomad_client/models/dns_config.rb | 3 +- .../lib/nomad_client/models/drain_metadata.rb | 5 +- .../v1/lib/nomad_client/models/drain_spec.rb | 3 +- .../lib/nomad_client/models/drain_strategy.rb | 5 +- .../v1/lib/nomad_client/models/driver_info.rb | 4 +- .../lib/nomad_client/models/ephemeral_disk.rb | 3 +- .../lib/nomad_client/models/eval_options.rb | 3 +- .../v1/lib/nomad_client/models/evaluation.rb | 4 +- .../nomad_client/models/evaluation_stub.rb | 4 +- .../v1/lib/nomad_client/models/field_diff.rb | 3 +- .../v1/lib/nomad_client/models/fuzzy_match.rb | 3 +- .../models/fuzzy_search_request.rb | 3 +- .../models/fuzzy_search_response.rb | 3 +- .../v1/lib/nomad_client/models/gauge_value.rb | 3 +- .../nomad_client/models/host_network_info.rb | 3 +- .../nomad_client/models/host_volume_info.rb | 3 +- .../ruby/v1/lib/nomad_client/models/job.rb | 5 +- .../models/job_children_summary.rb | 3 +- .../models/job_deregister_response.rb | 3 +- .../v1/lib/nomad_client/models/job_diff.rb | 3 +- .../models/job_dispatch_request.rb | 3 +- .../models/job_dispatch_response.rb | 3 +- .../models/job_evaluate_request.rb | 4 +- .../lib/nomad_client/models/job_list_stub.rb | 4 +- .../nomad_client/models/job_plan_request.rb | 4 +- .../nomad_client/models/job_plan_response.rb | 6 +- .../models/job_register_request.rb | 4 +- .../models/job_register_response.rb | 3 +- .../nomad_client/models/job_revert_request.rb | 3 +- .../models/job_scale_status_response.rb | 3 +- .../models/job_stability_request.rb | 3 +- .../models/job_stability_response.rb | 3 +- .../v1/lib/nomad_client/models/job_summary.rb | 4 +- .../models/job_validate_request.rb | 4 +- .../models/job_validate_response.rb | 3 +- .../models/job_versions_response.rb | 3 +- .../nomad_client/models/jobs_parse_request.rb | 3 +- .../v1/lib/nomad_client/models/log_config.rb | 3 +- .../nomad_client/models/metrics_summary.rb | 3 +- .../nomad_client/models/migrate_strategy.rb | 3 +- .../v1/lib/nomad_client/models/multiregion.rb | 3 +- .../nomad_client/models/multiregion_region.rb | 3 +- .../models/multiregion_strategy.rb | 3 +- .../v1/lib/nomad_client/models/namespace.rb | 4 +- .../models/namespace_capabilities.rb | 3 +- .../nomad_client/models/network_resource.rb | 4 +- .../ruby/v1/lib/nomad_client/models/node.rb | 9 +- .../nomad_client/models/node_cpu_resources.rb | 3 +- .../v1/lib/nomad_client/models/node_device.rb | 4 +- .../models/node_device_locality.rb | 3 +- .../models/node_device_resource.rb | 3 +- .../models/node_disk_resources.rb | 3 +- .../models/node_drain_update_response.rb | 3 +- .../node_eligibility_update_response.rb | 3 +- .../v1/lib/nomad_client/models/node_event.rb | 4 +- .../lib/nomad_client/models/node_list_stub.rb | 6 +- .../models/node_memory_resources.rb | 3 +- .../models/node_purge_response.rb | 3 +- .../models/node_reserved_cpu_resources.rb | 3 +- .../models/node_reserved_disk_resources.rb | 3 +- .../models/node_reserved_memory_resources.rb | 3 +- .../models/node_reserved_network_resources.rb | 3 +- .../models/node_reserved_resources.rb | 7 +- .../lib/nomad_client/models/node_resources.rb | 6 +- .../nomad_client/models/node_score_meta.rb | 3 +- .../models/node_update_drain_request.rb | 4 +- .../models/node_update_eligibility_request.rb | 3 +- .../v1/lib/nomad_client/models/object_diff.rb | 3 +- .../lib/nomad_client/models/one_time_token.rb | 4 +- .../models/one_time_token_exchange_request.rb | 3 +- .../models/operator_health_reply.rb | 3 +- .../models/parameterized_job_config.rb | 3 +- .../nomad_client/models/periodic_config.rb | 3 +- .../models/periodic_force_response.rb | 3 +- .../nomad_client/models/plan_annotations.rb | 3 +- .../v1/lib/nomad_client/models/point_value.rb | 3 +- .../ruby/v1/lib/nomad_client/models/port.rb | 3 +- .../lib/nomad_client/models/port_mapping.rb | 3 +- .../nomad_client/models/preemption_config.rb | 3 +- .../v1/lib/nomad_client/models/quota_limit.rb | 4 +- .../v1/lib/nomad_client/models/quota_spec.rb | 3 +- .../nomad_client/models/raft_configuration.rb | 3 +- .../v1/lib/nomad_client/models/raft_server.rb | 3 +- .../nomad_client/models/requested_device.rb | 3 +- .../nomad_client/models/reschedule_event.rb | 3 +- .../nomad_client/models/reschedule_policy.rb | 3 +- .../nomad_client/models/reschedule_tracker.rb | 3 +- .../v1/lib/nomad_client/models/resources.rb | 3 +- .../lib/nomad_client/models/restart_policy.rb | 3 +- .../lib/nomad_client/models/sampled_value.rb | 3 +- .../lib/nomad_client/models/scaling_event.rb | 5 +- .../lib/nomad_client/models/scaling_policy.rb | 5 +- .../models/scaling_policy_list_stub.rb | 3 +- .../nomad_client/models/scaling_request.rb | 5 +- .../models/scheduler_configuration.rb | 4 +- .../scheduler_configuration_response.rb | 4 +- .../scheduler_set_configuration_response.rb | 3 +- .../lib/nomad_client/models/search_request.rb | 3 +- .../nomad_client/models/search_response.rb | 3 +- .../lib/nomad_client/models/server_health.rb | 4 +- .../v1/lib/nomad_client/models/service.rb | 5 +- .../lib/nomad_client/models/service_check.rb | 4 +- .../models/service_registration.rb | 3 +- .../lib/nomad_client/models/sidecar_task.rb | 6 +- .../ruby/v1/lib/nomad_client/models/spread.rb | 3 +- .../lib/nomad_client/models/spread_target.rb | 3 +- .../ruby/v1/lib/nomad_client/models/task.rb | 10 +- .../lib/nomad_client/models/task_artifact.rb | 3 +- .../models/task_csi_plugin_config.rb | 3 +- .../v1/lib/nomad_client/models/task_diff.rb | 3 +- .../v1/lib/nomad_client/models/task_event.rb | 3 +- .../v1/lib/nomad_client/models/task_group.rb | 5 +- .../nomad_client/models/task_group_diff.rb | 3 +- .../models/task_group_scale_status.rb | 3 +- .../nomad_client/models/task_group_summary.rb | 3 +- .../v1/lib/nomad_client/models/task_handle.rb | 3 +- .../lib/nomad_client/models/task_lifecycle.rb | 3 +- .../v1/lib/nomad_client/models/task_state.rb | 7 +- .../v1/lib/nomad_client/models/template.rb | 3 +- .../nomad_client/models/update_strategy.rb | 3 +- .../ruby/v1/lib/nomad_client/models/vault.rb | 3 +- .../lib/nomad_client/models/volume_mount.rb | 3 +- .../lib/nomad_client/models/volume_request.rb | 4 +- .../v1/lib/nomad_client/models/wait_config.rb | 3 +- clients/ruby/v1/lib/nomad_client/version.rb | 2 +- clients/ruby/v1/nomad_client.gemspec | 2 +- clients/ruby/v1/spec/api/acl_api_spec.rb | 2 +- .../ruby/v1/spec/api/allocations_api_spec.rb | 2 +- .../ruby/v1/spec/api/deployments_api_spec.rb | 2 +- .../ruby/v1/spec/api/enterprise_api_spec.rb | 4 +- .../ruby/v1/spec/api/evaluations_api_spec.rb | 2 +- clients/ruby/v1/spec/api/jobs_api_spec.rb | 2 +- clients/ruby/v1/spec/api/metrics_api_spec.rb | 2 +- .../ruby/v1/spec/api/namespaces_api_spec.rb | 2 +- clients/ruby/v1/spec/api/nodes_api_spec.rb | 2 +- clients/ruby/v1/spec/api/operator_api_spec.rb | 2 +- clients/ruby/v1/spec/api/plugins_api_spec.rb | 2 +- clients/ruby/v1/spec/api/regions_api_spec.rb | 2 +- clients/ruby/v1/spec/api/scaling_api_spec.rb | 2 +- clients/ruby/v1/spec/api/search_api_spec.rb | 2 +- clients/ruby/v1/spec/api/status_api_spec.rb | 2 +- clients/ruby/v1/spec/api/system_api_spec.rb | 2 +- clients/ruby/v1/spec/api/volumes_api_spec.rb | 2 +- clients/ruby/v1/spec/api_client_spec.rb | 6 +- clients/ruby/v1/spec/configuration_spec.rb | 2 +- .../spec/models/acl_policy_list_stub_spec.rb | 2 +- .../ruby/v1/spec/models/acl_policy_spec.rb | 2 +- .../spec/models/acl_token_list_stub_spec.rb | 2 +- clients/ruby/v1/spec/models/acl_token_spec.rb | 2 +- clients/ruby/v1/spec/models/affinity_spec.rb | 2 +- .../models/alloc_deployment_status_spec.rb | 2 +- .../spec/models/alloc_stop_response_spec.rb | 2 +- .../models/allocated_cpu_resources_spec.rb | 2 +- .../models/allocated_device_resource_spec.rb | 2 +- .../models/allocated_memory_resources_spec.rb | 2 +- .../spec/models/allocated_resources_spec.rb | 2 +- .../models/allocated_shared_resources_spec.rb | 2 +- .../models/allocated_task_resources_spec.rb | 2 +- .../spec/models/allocation_list_stub_spec.rb | 2 +- .../v1/spec/models/allocation_metric_spec.rb | 2 +- .../ruby/v1/spec/models/allocation_spec.rb | 2 +- clients/ruby/v1/spec/models/attribute_spec.rb | 2 +- .../models/autopilot_configuration_spec.rb | 2 +- .../ruby/v1/spec/models/check_restart_spec.rb | 2 +- .../ruby/v1/spec/models/constraint_spec.rb | 2 +- .../v1/spec/models/consul_connect_spec.rb | 2 +- .../spec/models/consul_expose_config_spec.rb | 2 +- .../v1/spec/models/consul_expose_path_spec.rb | 2 +- .../consul_gateway_bind_address_spec.rb | 2 +- .../spec/models/consul_gateway_proxy_spec.rb | 2 +- .../v1/spec/models/consul_gateway_spec.rb | 2 +- .../models/consul_gateway_tls_config_spec.rb | 2 +- .../consul_ingress_config_entry_spec.rb | 2 +- .../models/consul_ingress_listener_spec.rb | 2 +- .../models/consul_ingress_service_spec.rb | 2 +- .../spec/models/consul_linked_service_spec.rb | 2 +- .../spec/models/consul_mesh_gateway_spec.rb | 2 +- .../ruby/v1/spec/models/consul_proxy_spec.rb | 2 +- .../models/consul_sidecar_service_spec.rb | 2 +- clients/ruby/v1/spec/models/consul_spec.rb | 2 +- .../consul_terminating_config_entry_spec.rb | 2 +- .../v1/spec/models/consul_upstream_spec.rb | 2 +- .../spec/models/csi_controller_info_spec.rb | 2 +- clients/ruby/v1/spec/models/csi_info_spec.rb | 2 +- .../v1/spec/models/csi_mount_options_spec.rb | 2 +- .../ruby/v1/spec/models/csi_node_info_spec.rb | 2 +- .../spec/models/csi_plugin_list_stub_spec.rb | 2 +- .../ruby/v1/spec/models/csi_plugin_spec.rb | 2 +- .../csi_snapshot_create_request_spec.rb | 2 +- .../csi_snapshot_create_response_spec.rb | 2 +- .../models/csi_snapshot_list_response_spec.rb | 2 +- .../ruby/v1/spec/models/csi_snapshot_spec.rb | 2 +- .../spec/models/csi_topology_request_spec.rb | 2 +- .../ruby/v1/spec/models/csi_topology_spec.rb | 2 +- .../spec/models/csi_volume_capability_spec.rb | 2 +- .../models/csi_volume_create_request_spec.rb | 2 +- .../models/csi_volume_external_stub_spec.rb | 2 +- .../csi_volume_list_external_response_spec.rb | 2 +- .../spec/models/csi_volume_list_stub_spec.rb | 2 +- .../csi_volume_register_request_spec.rb | 2 +- .../ruby/v1/spec/models/csi_volume_spec.rb | 2 +- .../deployment_alloc_health_request_spec.rb | 2 +- .../models/deployment_pause_request_spec.rb | 2 +- .../models/deployment_promote_request_spec.rb | 2 +- .../ruby/v1/spec/models/deployment_spec.rb | 2 +- .../v1/spec/models/deployment_state_spec.rb | 2 +- .../models/deployment_unblock_request_spec.rb | 2 +- .../models/deployment_update_response_spec.rb | 2 +- .../v1/spec/models/desired_transition_spec.rb | 2 +- .../v1/spec/models/desired_updates_spec.rb | 2 +- .../models/dispatch_payload_config_spec.rb | 2 +- .../ruby/v1/spec/models/dns_config_spec.rb | 2 +- .../v1/spec/models/drain_metadata_spec.rb | 2 +- .../ruby/v1/spec/models/drain_spec_spec.rb | 2 +- .../v1/spec/models/drain_strategy_spec.rb | 2 +- .../ruby/v1/spec/models/driver_info_spec.rb | 2 +- .../v1/spec/models/ephemeral_disk_spec.rb | 2 +- .../ruby/v1/spec/models/eval_options_spec.rb | 2 +- .../ruby/v1/spec/models/evaluation_spec.rb | 2 +- .../v1/spec/models/evaluation_stub_spec.rb | 2 +- .../ruby/v1/spec/models/field_diff_spec.rb | 2 +- .../ruby/v1/spec/models/fuzzy_match_spec.rb | 2 +- .../spec/models/fuzzy_search_request_spec.rb | 2 +- .../spec/models/fuzzy_search_response_spec.rb | 2 +- .../ruby/v1/spec/models/gauge_value_spec.rb | 2 +- .../v1/spec/models/host_network_info_spec.rb | 2 +- .../v1/spec/models/host_volume_info_spec.rb | 2 +- .../spec/models/job_children_summary_spec.rb | 2 +- .../models/job_deregister_response_spec.rb | 2 +- clients/ruby/v1/spec/models/job_diff_spec.rb | 2 +- .../spec/models/job_dispatch_request_spec.rb | 2 +- .../spec/models/job_dispatch_response_spec.rb | 2 +- .../spec/models/job_evaluate_request_spec.rb | 2 +- .../ruby/v1/spec/models/job_list_stub_spec.rb | 2 +- .../v1/spec/models/job_plan_request_spec.rb | 2 +- .../v1/spec/models/job_plan_response_spec.rb | 2 +- .../spec/models/job_register_request_spec.rb | 2 +- .../spec/models/job_register_response_spec.rb | 2 +- .../v1/spec/models/job_revert_request_spec.rb | 2 +- .../models/job_scale_status_response_spec.rb | 2 +- clients/ruby/v1/spec/models/job_spec.rb | 2 +- .../spec/models/job_stability_request_spec.rb | 2 +- .../models/job_stability_response_spec.rb | 2 +- .../ruby/v1/spec/models/job_summary_spec.rb | 2 +- .../spec/models/job_validate_request_spec.rb | 2 +- .../spec/models/job_validate_response_spec.rb | 2 +- .../spec/models/job_versions_response_spec.rb | 2 +- .../v1/spec/models/jobs_parse_request_spec.rb | 2 +- .../ruby/v1/spec/models/log_config_spec.rb | 2 +- .../v1/spec/models/metrics_summary_spec.rb | 2 +- .../v1/spec/models/migrate_strategy_spec.rb | 2 +- .../v1/spec/models/multiregion_region_spec.rb | 2 +- .../ruby/v1/spec/models/multiregion_spec.rb | 2 +- .../spec/models/multiregion_strategy_spec.rb | 2 +- .../models/namespace_capabilities_spec.rb | 2 +- clients/ruby/v1/spec/models/namespace_spec.rb | 2 +- .../v1/spec/models/network_resource_spec.rb | 2 +- .../v1/spec/models/node_cpu_resources_spec.rb | 2 +- .../spec/models/node_device_locality_spec.rb | 2 +- .../spec/models/node_device_resource_spec.rb | 2 +- .../ruby/v1/spec/models/node_device_spec.rb | 2 +- .../spec/models/node_disk_resources_spec.rb | 2 +- .../models/node_drain_update_response_spec.rb | 2 +- .../node_eligibility_update_response_spec.rb | 2 +- .../ruby/v1/spec/models/node_event_spec.rb | 2 +- .../v1/spec/models/node_list_stub_spec.rb | 2 +- .../spec/models/node_memory_resources_spec.rb | 2 +- .../spec/models/node_purge_response_spec.rb | 2 +- .../node_reserved_cpu_resources_spec.rb | 2 +- .../node_reserved_disk_resources_spec.rb | 2 +- .../node_reserved_memory_resources_spec.rb | 2 +- .../node_reserved_network_resources_spec.rb | 2 +- .../models/node_reserved_resources_spec.rb | 2 +- .../v1/spec/models/node_resources_spec.rb | 2 +- .../v1/spec/models/node_score_meta_spec.rb | 2 +- clients/ruby/v1/spec/models/node_spec.rb | 2 +- .../models/node_update_drain_request_spec.rb | 2 +- .../node_update_eligibility_request_spec.rb | 2 +- .../ruby/v1/spec/models/object_diff_spec.rb | 2 +- .../one_time_token_exchange_request_spec.rb | 2 +- .../v1/spec/models/one_time_token_spec.rb | 2 +- .../spec/models/operator_health_reply_spec.rb | 2 +- .../models/parameterized_job_config_spec.rb | 2 +- .../v1/spec/models/periodic_config_spec.rb | 2 +- .../models/periodic_force_response_spec.rb | 2 +- .../v1/spec/models/plan_annotations_spec.rb | 2 +- .../ruby/v1/spec/models/point_value_spec.rb | 2 +- .../ruby/v1/spec/models/port_mapping_spec.rb | 2 +- clients/ruby/v1/spec/models/port_spec.rb | 2 +- .../v1/spec/models/preemption_config_spec.rb | 2 +- .../ruby/v1/spec/models/quota_limit_spec.rb | 2 +- .../ruby/v1/spec/models/quota_spec_spec.rb | 2 +- .../v1/spec/models/raft_configuration_spec.rb | 2 +- .../ruby/v1/spec/models/raft_server_spec.rb | 2 +- .../v1/spec/models/requested_device_spec.rb | 2 +- .../v1/spec/models/reschedule_event_spec.rb | 2 +- .../v1/spec/models/reschedule_policy_spec.rb | 2 +- .../v1/spec/models/reschedule_tracker_spec.rb | 2 +- clients/ruby/v1/spec/models/resources_spec.rb | 2 +- .../v1/spec/models/restart_policy_spec.rb | 2 +- .../ruby/v1/spec/models/sampled_value_spec.rb | 2 +- .../ruby/v1/spec/models/scaling_event_spec.rb | 2 +- .../models/scaling_policy_list_stub_spec.rb | 2 +- .../v1/spec/models/scaling_policy_spec.rb | 2 +- .../v1/spec/models/scaling_request_spec.rb | 2 +- .../scheduler_configuration_response_spec.rb | 2 +- .../models/scheduler_configuration_spec.rb | 2 +- ...heduler_set_configuration_response_spec.rb | 2 +- .../v1/spec/models/search_request_spec.rb | 2 +- .../v1/spec/models/search_response_spec.rb | 2 +- .../ruby/v1/spec/models/server_health_spec.rb | 2 +- .../ruby/v1/spec/models/service_check_spec.rb | 2 +- .../spec/models/service_registration_spec.rb | 2 +- clients/ruby/v1/spec/models/service_spec.rb | 2 +- .../ruby/v1/spec/models/sidecar_task_spec.rb | 2 +- clients/ruby/v1/spec/models/spread_spec.rb | 2 +- .../ruby/v1/spec/models/spread_target_spec.rb | 2 +- .../ruby/v1/spec/models/task_artifact_spec.rb | 2 +- .../models/task_csi_plugin_config_spec.rb | 2 +- clients/ruby/v1/spec/models/task_diff_spec.rb | 2 +- .../ruby/v1/spec/models/task_event_spec.rb | 2 +- .../v1/spec/models/task_group_diff_spec.rb | 2 +- .../models/task_group_scale_status_spec.rb | 2 +- .../ruby/v1/spec/models/task_group_spec.rb | 2 +- .../v1/spec/models/task_group_summary_spec.rb | 2 +- .../ruby/v1/spec/models/task_handle_spec.rb | 2 +- .../v1/spec/models/task_lifecycle_spec.rb | 2 +- clients/ruby/v1/spec/models/task_spec.rb | 2 +- .../ruby/v1/spec/models/task_state_spec.rb | 2 +- clients/ruby/v1/spec/models/template_spec.rb | 2 +- .../v1/spec/models/update_strategy_spec.rb | 2 +- clients/ruby/v1/spec/models/vault_spec.rb | 2 +- .../ruby/v1/spec/models/volume_mount_spec.rb | 2 +- .../v1/spec/models/volume_request_spec.rb | 2 +- .../ruby/v1/spec/models/wait_config_spec.rb | 2 +- clients/ruby/v1/spec/spec_helper.rb | 2 +- .../rust/hyper/v1/.openapi-generator/VERSION | 2 +- clients/rust/hyper/v1/Cargo.toml | 6 +- clients/rust/hyper/v1/docs/ACLApi.md | 6 +- clients/rust/hyper/v1/docs/DeploymentsApi.md | 8 +- clients/rust/hyper/v1/docs/EnterpriseApi.md | 4 +- clients/rust/hyper/v1/docs/JobsApi.md | 20 +- clients/rust/hyper/v1/docs/NamespacesApi.md | 2 +- clients/rust/hyper/v1/docs/NodesApi.md | 4 +- clients/rust/hyper/v1/docs/OperatorApi.md | 4 +- clients/rust/hyper/v1/docs/SearchApi.md | 4 +- clients/rust/hyper/v1/docs/VolumesApi.md | 8 +- clients/rust/hyper/v1/src/apis/acl_api.rs | 263 +- .../rust/hyper/v1/src/apis/allocations_api.rs | 132 +- clients/rust/hyper/v1/src/apis/client.rs | 3 +- .../rust/hyper/v1/src/apis/configuration.rs | 8 +- .../rust/hyper/v1/src/apis/deployments_api.rs | 175 +- .../rust/hyper/v1/src/apis/enterprise_api.rs | 115 +- .../rust/hyper/v1/src/apis/evaluations_api.rs | 95 +- clients/rust/hyper/v1/src/apis/jobs_api.rs | 461 +- clients/rust/hyper/v1/src/apis/metrics_api.rs | 21 +- clients/rust/hyper/v1/src/apis/mod.rs | 48 +- .../rust/hyper/v1/src/apis/namespaces_api.rs | 115 +- clients/rust/hyper/v1/src/apis/nodes_api.rs | 182 +- .../rust/hyper/v1/src/apis/operator_api.rs | 171 +- clients/rust/hyper/v1/src/apis/plugins_api.rs | 67 +- clients/rust/hyper/v1/src/apis/regions_api.rs | 18 +- clients/rust/hyper/v1/src/apis/request.rs | 205 +- clients/rust/hyper/v1/src/apis/scaling_api.rs | 67 +- clients/rust/hyper/v1/src/apis/search_api.rs | 67 +- clients/rust/hyper/v1/src/apis/status_api.rs | 67 +- clients/rust/hyper/v1/src/apis/system_api.rs | 43 +- clients/rust/hyper/v1/src/apis/volumes_api.rs | 262 +- .../rust/hyper/v1/src/models/acl_policy.rs | 2 +- .../v1/src/models/acl_policy_list_stub.rs | 2 +- clients/rust/hyper/v1/src/models/acl_token.rs | 2 +- .../v1/src/models/acl_token_list_stub.rs | 2 +- clients/rust/hyper/v1/src/models/affinity.rs | 2 +- .../v1/src/models/alloc_deployment_status.rs | 2 +- .../v1/src/models/alloc_stop_response.rs | 2 +- .../v1/src/models/allocated_cpu_resources.rs | 2 +- .../src/models/allocated_device_resource.rs | 2 +- .../src/models/allocated_memory_resources.rs | 2 +- .../v1/src/models/allocated_resources.rs | 2 +- .../src/models/allocated_shared_resources.rs | 2 +- .../v1/src/models/allocated_task_resources.rs | 2 +- .../rust/hyper/v1/src/models/allocation.rs | 2 +- .../v1/src/models/allocation_list_stub.rs | 2 +- .../hyper/v1/src/models/allocation_metric.rs | 2 +- clients/rust/hyper/v1/src/models/attribute.rs | 2 +- .../v1/src/models/autopilot_configuration.rs | 2 +- .../rust/hyper/v1/src/models/check_restart.rs | 2 +- .../rust/hyper/v1/src/models/constraint.rs | 2 +- clients/rust/hyper/v1/src/models/consul.rs | 2 +- .../hyper/v1/src/models/consul_connect.rs | 2 +- .../v1/src/models/consul_expose_config.rs | 2 +- .../hyper/v1/src/models/consul_expose_path.rs | 2 +- .../hyper/v1/src/models/consul_gateway.rs | 2 +- .../src/models/consul_gateway_bind_address.rs | 2 +- .../v1/src/models/consul_gateway_proxy.rs | 2 +- .../src/models/consul_gateway_tls_config.rs | 2 +- .../src/models/consul_ingress_config_entry.rs | 2 +- .../v1/src/models/consul_ingress_listener.rs | 2 +- .../v1/src/models/consul_ingress_service.rs | 2 +- .../v1/src/models/consul_linked_service.rs | 2 +- .../v1/src/models/consul_mesh_gateway.rs | 2 +- .../rust/hyper/v1/src/models/consul_proxy.rs | 2 +- .../v1/src/models/consul_sidecar_service.rs | 2 +- .../models/consul_terminating_config_entry.rs | 2 +- .../hyper/v1/src/models/consul_upstream.rs | 2 +- .../v1/src/models/csi_controller_info.rs | 2 +- clients/rust/hyper/v1/src/models/csi_info.rs | 2 +- .../hyper/v1/src/models/csi_mount_options.rs | 2 +- .../rust/hyper/v1/src/models/csi_node_info.rs | 2 +- .../rust/hyper/v1/src/models/csi_plugin.rs | 2 +- .../v1/src/models/csi_plugin_list_stub.rs | 2 +- .../rust/hyper/v1/src/models/csi_snapshot.rs | 2 +- .../src/models/csi_snapshot_create_request.rs | 2 +- .../models/csi_snapshot_create_response.rs | 2 +- .../src/models/csi_snapshot_list_response.rs | 2 +- .../rust/hyper/v1/src/models/csi_topology.rs | 2 +- .../v1/src/models/csi_topology_request.rs | 2 +- .../rust/hyper/v1/src/models/csi_volume.rs | 2 +- .../v1/src/models/csi_volume_capability.rs | 2 +- .../src/models/csi_volume_create_request.rs | 2 +- .../v1/src/models/csi_volume_external_stub.rs | 2 +- .../csi_volume_list_external_response.rs | 2 +- .../v1/src/models/csi_volume_list_stub.rs | 2 +- .../src/models/csi_volume_register_request.rs | 2 +- .../rust/hyper/v1/src/models/deployment.rs | 2 +- .../models/deployment_alloc_health_request.rs | 2 +- .../v1/src/models/deployment_pause_request.rs | 2 +- .../src/models/deployment_promote_request.rs | 2 +- .../hyper/v1/src/models/deployment_state.rs | 2 +- .../src/models/deployment_unblock_request.rs | 2 +- .../src/models/deployment_update_response.rs | 2 +- .../hyper/v1/src/models/desired_transition.rs | 2 +- .../hyper/v1/src/models/desired_updates.rs | 2 +- .../v1/src/models/dispatch_payload_config.rs | 2 +- .../rust/hyper/v1/src/models/dns_config.rs | 2 +- .../hyper/v1/src/models/drain_metadata.rs | 2 +- .../rust/hyper/v1/src/models/drain_spec.rs | 2 +- .../hyper/v1/src/models/drain_strategy.rs | 2 +- .../rust/hyper/v1/src/models/driver_info.rs | 2 +- .../hyper/v1/src/models/ephemeral_disk.rs | 2 +- .../rust/hyper/v1/src/models/eval_options.rs | 2 +- .../rust/hyper/v1/src/models/evaluation.rs | 2 +- .../hyper/v1/src/models/evaluation_stub.rs | 2 +- .../rust/hyper/v1/src/models/field_diff.rs | 2 +- .../rust/hyper/v1/src/models/fuzzy_match.rs | 2 +- .../v1/src/models/fuzzy_search_request.rs | 2 +- .../v1/src/models/fuzzy_search_response.rs | 2 +- .../rust/hyper/v1/src/models/gauge_value.rs | 2 +- .../hyper/v1/src/models/host_network_info.rs | 2 +- .../hyper/v1/src/models/host_volume_info.rs | 2 +- clients/rust/hyper/v1/src/models/job.rs | 2 +- .../v1/src/models/job_children_summary.rs | 2 +- .../v1/src/models/job_deregister_response.rs | 2 +- clients/rust/hyper/v1/src/models/job_diff.rs | 2 +- .../v1/src/models/job_dispatch_request.rs | 2 +- .../v1/src/models/job_dispatch_response.rs | 2 +- .../v1/src/models/job_evaluate_request.rs | 2 +- .../rust/hyper/v1/src/models/job_list_stub.rs | 2 +- .../hyper/v1/src/models/job_plan_request.rs | 2 +- .../hyper/v1/src/models/job_plan_response.rs | 2 +- .../v1/src/models/job_register_request.rs | 2 +- .../v1/src/models/job_register_response.rs | 2 +- .../hyper/v1/src/models/job_revert_request.rs | 2 +- .../src/models/job_scale_status_response.rs | 2 +- .../v1/src/models/job_stability_request.rs | 2 +- .../v1/src/models/job_stability_response.rs | 2 +- .../rust/hyper/v1/src/models/job_summary.rs | 2 +- .../v1/src/models/job_validate_request.rs | 2 +- .../v1/src/models/job_validate_response.rs | 2 +- .../v1/src/models/job_versions_response.rs | 2 +- .../hyper/v1/src/models/jobs_parse_request.rs | 2 +- .../rust/hyper/v1/src/models/log_config.rs | 2 +- .../hyper/v1/src/models/metrics_summary.rs | 2 +- .../hyper/v1/src/models/migrate_strategy.rs | 2 +- .../rust/hyper/v1/src/models/multiregion.rs | 2 +- .../hyper/v1/src/models/multiregion_region.rs | 2 +- .../v1/src/models/multiregion_strategy.rs | 2 +- clients/rust/hyper/v1/src/models/namespace.rs | 2 +- .../v1/src/models/namespace_capabilities.rs | 2 +- .../hyper/v1/src/models/network_resource.rs | 2 +- clients/rust/hyper/v1/src/models/node.rs | 2 +- .../hyper/v1/src/models/node_cpu_resources.rs | 2 +- .../rust/hyper/v1/src/models/node_device.rs | 2 +- .../v1/src/models/node_device_locality.rs | 2 +- .../v1/src/models/node_device_resource.rs | 2 +- .../v1/src/models/node_disk_resources.rs | 2 +- .../src/models/node_drain_update_response.rs | 2 +- .../node_eligibility_update_response.rs | 2 +- .../rust/hyper/v1/src/models/node_event.rs | 2 +- .../hyper/v1/src/models/node_list_stub.rs | 2 +- .../v1/src/models/node_memory_resources.rs | 2 +- .../v1/src/models/node_purge_response.rs | 2 +- .../src/models/node_reserved_cpu_resources.rs | 2 +- .../models/node_reserved_disk_resources.rs | 2 +- .../models/node_reserved_memory_resources.rs | 2 +- .../models/node_reserved_network_resources.rs | 2 +- .../v1/src/models/node_reserved_resources.rs | 2 +- .../hyper/v1/src/models/node_resources.rs | 2 +- .../hyper/v1/src/models/node_score_meta.rs | 2 +- .../src/models/node_update_drain_request.rs | 2 +- .../models/node_update_eligibility_request.rs | 2 +- .../rust/hyper/v1/src/models/object_diff.rs | 2 +- .../hyper/v1/src/models/one_time_token.rs | 2 +- .../models/one_time_token_exchange_request.rs | 2 +- .../v1/src/models/operator_health_reply.rs | 2 +- .../v1/src/models/parameterized_job_config.rs | 2 +- .../hyper/v1/src/models/periodic_config.rs | 2 +- .../v1/src/models/periodic_force_response.rs | 2 +- .../hyper/v1/src/models/plan_annotations.rs | 2 +- .../rust/hyper/v1/src/models/point_value.rs | 2 +- clients/rust/hyper/v1/src/models/port.rs | 2 +- .../rust/hyper/v1/src/models/port_mapping.rs | 2 +- .../hyper/v1/src/models/preemption_config.rs | 2 +- .../rust/hyper/v1/src/models/quota_limit.rs | 2 +- .../rust/hyper/v1/src/models/quota_spec.rs | 2 +- .../hyper/v1/src/models/raft_configuration.rs | 2 +- .../rust/hyper/v1/src/models/raft_server.rs | 2 +- .../hyper/v1/src/models/requested_device.rs | 2 +- .../hyper/v1/src/models/reschedule_event.rs | 2 +- .../hyper/v1/src/models/reschedule_policy.rs | 2 +- .../hyper/v1/src/models/reschedule_tracker.rs | 2 +- clients/rust/hyper/v1/src/models/resources.rs | 2 +- .../hyper/v1/src/models/restart_policy.rs | 2 +- .../rust/hyper/v1/src/models/sampled_value.rs | 2 +- .../rust/hyper/v1/src/models/scaling_event.rs | 2 +- .../hyper/v1/src/models/scaling_policy.rs | 2 +- .../v1/src/models/scaling_policy_list_stub.rs | 2 +- .../hyper/v1/src/models/scaling_request.rs | 2 +- .../v1/src/models/scheduler_configuration.rs | 2 +- .../scheduler_configuration_response.rs | 2 +- .../scheduler_set_configuration_response.rs | 2 +- .../hyper/v1/src/models/search_request.rs | 2 +- .../hyper/v1/src/models/search_response.rs | 2 +- .../rust/hyper/v1/src/models/server_health.rs | 2 +- clients/rust/hyper/v1/src/models/service.rs | 2 +- .../rust/hyper/v1/src/models/service_check.rs | 2 +- .../v1/src/models/service_registration.rs | 2 +- .../rust/hyper/v1/src/models/sidecar_task.rs | 2 +- clients/rust/hyper/v1/src/models/spread.rs | 2 +- .../rust/hyper/v1/src/models/spread_target.rs | 2 +- clients/rust/hyper/v1/src/models/task.rs | 2 +- .../rust/hyper/v1/src/models/task_artifact.rs | 2 +- .../v1/src/models/task_csi_plugin_config.rs | 2 +- clients/rust/hyper/v1/src/models/task_diff.rs | 2 +- .../rust/hyper/v1/src/models/task_event.rs | 2 +- .../rust/hyper/v1/src/models/task_group.rs | 2 +- .../hyper/v1/src/models/task_group_diff.rs | 2 +- .../v1/src/models/task_group_scale_status.rs | 2 +- .../hyper/v1/src/models/task_group_summary.rs | 2 +- .../rust/hyper/v1/src/models/task_handle.rs | 2 +- .../hyper/v1/src/models/task_lifecycle.rs | 2 +- .../rust/hyper/v1/src/models/task_state.rs | 2 +- clients/rust/hyper/v1/src/models/template.rs | 2 +- .../hyper/v1/src/models/update_strategy.rs | 2 +- clients/rust/hyper/v1/src/models/vault.rs | 2 +- .../rust/hyper/v1/src/models/volume_mount.rs | 2 +- .../hyper/v1/src/models/volume_request.rs | 2 +- .../rust/hyper/v1/src/models/wait_config.rs | 2 +- .../reqwest/v1/.openapi-generator/VERSION | 2 +- clients/rust/reqwest/v1/Cargo.toml | 1 - clients/rust/reqwest/v1/docs/ACLApi.md | 6 +- .../rust/reqwest/v1/docs/DeploymentsApi.md | 8 +- clients/rust/reqwest/v1/docs/EnterpriseApi.md | 4 +- clients/rust/reqwest/v1/docs/JobsApi.md | 20 +- clients/rust/reqwest/v1/docs/NamespacesApi.md | 2 +- clients/rust/reqwest/v1/docs/NodesApi.md | 4 +- clients/rust/reqwest/v1/docs/OperatorApi.md | 4 +- clients/rust/reqwest/v1/docs/SearchApi.md | 4 +- clients/rust/reqwest/v1/docs/VolumesApi.md | 8 +- clients/rust/reqwest/v1/src/apis/acl_api.rs | 138 +- .../reqwest/v1/src/apis/allocations_api.rs | 44 +- .../rust/reqwest/v1/src/apis/configuration.rs | 3 + .../reqwest/v1/src/apis/deployments_api.rs | 96 +- .../reqwest/v1/src/apis/enterprise_api.rs | 59 +- .../reqwest/v1/src/apis/evaluations_api.rs | 33 +- clients/rust/reqwest/v1/src/apis/jobs_api.rs | 251 +- .../rust/reqwest/v1/src/apis/metrics_api.rs | 11 +- .../reqwest/v1/src/apis/namespaces_api.rs | 57 +- clients/rust/reqwest/v1/src/apis/nodes_api.rs | 70 +- .../rust/reqwest/v1/src/apis/operator_api.rs | 81 +- .../rust/reqwest/v1/src/apis/plugins_api.rs | 22 +- .../rust/reqwest/v1/src/apis/regions_api.rs | 11 +- .../rust/reqwest/v1/src/apis/scaling_api.rs | 22 +- .../rust/reqwest/v1/src/apis/search_api.rs | 26 +- .../rust/reqwest/v1/src/apis/status_api.rs | 22 +- .../rust/reqwest/v1/src/apis/system_api.rs | 22 +- .../rust/reqwest/v1/src/apis/volumes_api.rs | 129 +- .../rust/reqwest/v1/src/models/acl_policy.rs | 2 +- .../v1/src/models/acl_policy_list_stub.rs | 2 +- .../rust/reqwest/v1/src/models/acl_token.rs | 2 +- .../v1/src/models/acl_token_list_stub.rs | 2 +- .../rust/reqwest/v1/src/models/affinity.rs | 2 +- .../v1/src/models/alloc_deployment_status.rs | 2 +- .../v1/src/models/alloc_stop_response.rs | 2 +- .../v1/src/models/allocated_cpu_resources.rs | 2 +- .../src/models/allocated_device_resource.rs | 2 +- .../src/models/allocated_memory_resources.rs | 2 +- .../v1/src/models/allocated_resources.rs | 2 +- .../src/models/allocated_shared_resources.rs | 2 +- .../v1/src/models/allocated_task_resources.rs | 2 +- .../rust/reqwest/v1/src/models/allocation.rs | 2 +- .../v1/src/models/allocation_list_stub.rs | 2 +- .../v1/src/models/allocation_metric.rs | 2 +- .../rust/reqwest/v1/src/models/attribute.rs | 2 +- .../v1/src/models/autopilot_configuration.rs | 2 +- .../reqwest/v1/src/models/check_restart.rs | 2 +- .../rust/reqwest/v1/src/models/constraint.rs | 2 +- clients/rust/reqwest/v1/src/models/consul.rs | 2 +- .../reqwest/v1/src/models/consul_connect.rs | 2 +- .../v1/src/models/consul_expose_config.rs | 2 +- .../v1/src/models/consul_expose_path.rs | 2 +- .../reqwest/v1/src/models/consul_gateway.rs | 2 +- .../src/models/consul_gateway_bind_address.rs | 2 +- .../v1/src/models/consul_gateway_proxy.rs | 2 +- .../src/models/consul_gateway_tls_config.rs | 2 +- .../src/models/consul_ingress_config_entry.rs | 2 +- .../v1/src/models/consul_ingress_listener.rs | 2 +- .../v1/src/models/consul_ingress_service.rs | 2 +- .../v1/src/models/consul_linked_service.rs | 2 +- .../v1/src/models/consul_mesh_gateway.rs | 2 +- .../reqwest/v1/src/models/consul_proxy.rs | 2 +- .../v1/src/models/consul_sidecar_service.rs | 2 +- .../models/consul_terminating_config_entry.rs | 2 +- .../reqwest/v1/src/models/consul_upstream.rs | 2 +- .../v1/src/models/csi_controller_info.rs | 2 +- .../rust/reqwest/v1/src/models/csi_info.rs | 2 +- .../v1/src/models/csi_mount_options.rs | 2 +- .../reqwest/v1/src/models/csi_node_info.rs | 2 +- .../rust/reqwest/v1/src/models/csi_plugin.rs | 2 +- .../v1/src/models/csi_plugin_list_stub.rs | 2 +- .../reqwest/v1/src/models/csi_snapshot.rs | 2 +- .../src/models/csi_snapshot_create_request.rs | 2 +- .../models/csi_snapshot_create_response.rs | 2 +- .../src/models/csi_snapshot_list_response.rs | 2 +- .../reqwest/v1/src/models/csi_topology.rs | 2 +- .../v1/src/models/csi_topology_request.rs | 2 +- .../rust/reqwest/v1/src/models/csi_volume.rs | 2 +- .../v1/src/models/csi_volume_capability.rs | 2 +- .../src/models/csi_volume_create_request.rs | 2 +- .../v1/src/models/csi_volume_external_stub.rs | 2 +- .../csi_volume_list_external_response.rs | 2 +- .../v1/src/models/csi_volume_list_stub.rs | 2 +- .../src/models/csi_volume_register_request.rs | 2 +- .../rust/reqwest/v1/src/models/deployment.rs | 2 +- .../models/deployment_alloc_health_request.rs | 2 +- .../v1/src/models/deployment_pause_request.rs | 2 +- .../src/models/deployment_promote_request.rs | 2 +- .../reqwest/v1/src/models/deployment_state.rs | 2 +- .../src/models/deployment_unblock_request.rs | 2 +- .../src/models/deployment_update_response.rs | 2 +- .../v1/src/models/desired_transition.rs | 2 +- .../reqwest/v1/src/models/desired_updates.rs | 2 +- .../v1/src/models/dispatch_payload_config.rs | 2 +- .../rust/reqwest/v1/src/models/dns_config.rs | 2 +- .../reqwest/v1/src/models/drain_metadata.rs | 2 +- .../rust/reqwest/v1/src/models/drain_spec.rs | 2 +- .../reqwest/v1/src/models/drain_strategy.rs | 2 +- .../rust/reqwest/v1/src/models/driver_info.rs | 2 +- .../reqwest/v1/src/models/ephemeral_disk.rs | 2 +- .../reqwest/v1/src/models/eval_options.rs | 2 +- .../rust/reqwest/v1/src/models/evaluation.rs | 2 +- .../reqwest/v1/src/models/evaluation_stub.rs | 2 +- .../rust/reqwest/v1/src/models/field_diff.rs | 2 +- .../rust/reqwest/v1/src/models/fuzzy_match.rs | 2 +- .../v1/src/models/fuzzy_search_request.rs | 2 +- .../v1/src/models/fuzzy_search_response.rs | 2 +- .../rust/reqwest/v1/src/models/gauge_value.rs | 2 +- .../v1/src/models/host_network_info.rs | 2 +- .../reqwest/v1/src/models/host_volume_info.rs | 2 +- clients/rust/reqwest/v1/src/models/job.rs | 2 +- .../v1/src/models/job_children_summary.rs | 2 +- .../v1/src/models/job_deregister_response.rs | 2 +- .../rust/reqwest/v1/src/models/job_diff.rs | 2 +- .../v1/src/models/job_dispatch_request.rs | 2 +- .../v1/src/models/job_dispatch_response.rs | 2 +- .../v1/src/models/job_evaluate_request.rs | 2 +- .../reqwest/v1/src/models/job_list_stub.rs | 2 +- .../reqwest/v1/src/models/job_plan_request.rs | 2 +- .../v1/src/models/job_plan_response.rs | 2 +- .../v1/src/models/job_register_request.rs | 2 +- .../v1/src/models/job_register_response.rs | 2 +- .../v1/src/models/job_revert_request.rs | 2 +- .../src/models/job_scale_status_response.rs | 2 +- .../v1/src/models/job_stability_request.rs | 2 +- .../v1/src/models/job_stability_response.rs | 2 +- .../rust/reqwest/v1/src/models/job_summary.rs | 2 +- .../v1/src/models/job_validate_request.rs | 2 +- .../v1/src/models/job_validate_response.rs | 2 +- .../v1/src/models/job_versions_response.rs | 2 +- .../v1/src/models/jobs_parse_request.rs | 2 +- .../rust/reqwest/v1/src/models/log_config.rs | 2 +- .../reqwest/v1/src/models/metrics_summary.rs | 2 +- .../reqwest/v1/src/models/migrate_strategy.rs | 2 +- .../rust/reqwest/v1/src/models/multiregion.rs | 2 +- .../v1/src/models/multiregion_region.rs | 2 +- .../v1/src/models/multiregion_strategy.rs | 2 +- .../rust/reqwest/v1/src/models/namespace.rs | 2 +- .../v1/src/models/namespace_capabilities.rs | 2 +- .../reqwest/v1/src/models/network_resource.rs | 2 +- clients/rust/reqwest/v1/src/models/node.rs | 2 +- .../v1/src/models/node_cpu_resources.rs | 2 +- .../rust/reqwest/v1/src/models/node_device.rs | 2 +- .../v1/src/models/node_device_locality.rs | 2 +- .../v1/src/models/node_device_resource.rs | 2 +- .../v1/src/models/node_disk_resources.rs | 2 +- .../src/models/node_drain_update_response.rs | 2 +- .../node_eligibility_update_response.rs | 2 +- .../rust/reqwest/v1/src/models/node_event.rs | 2 +- .../reqwest/v1/src/models/node_list_stub.rs | 2 +- .../v1/src/models/node_memory_resources.rs | 2 +- .../v1/src/models/node_purge_response.rs | 2 +- .../src/models/node_reserved_cpu_resources.rs | 2 +- .../models/node_reserved_disk_resources.rs | 2 +- .../models/node_reserved_memory_resources.rs | 2 +- .../models/node_reserved_network_resources.rs | 2 +- .../v1/src/models/node_reserved_resources.rs | 2 +- .../reqwest/v1/src/models/node_resources.rs | 2 +- .../reqwest/v1/src/models/node_score_meta.rs | 2 +- .../src/models/node_update_drain_request.rs | 2 +- .../models/node_update_eligibility_request.rs | 2 +- .../rust/reqwest/v1/src/models/object_diff.rs | 2 +- .../reqwest/v1/src/models/one_time_token.rs | 2 +- .../models/one_time_token_exchange_request.rs | 2 +- .../v1/src/models/operator_health_reply.rs | 2 +- .../v1/src/models/parameterized_job_config.rs | 2 +- .../reqwest/v1/src/models/periodic_config.rs | 2 +- .../v1/src/models/periodic_force_response.rs | 2 +- .../reqwest/v1/src/models/plan_annotations.rs | 2 +- .../rust/reqwest/v1/src/models/point_value.rs | 2 +- clients/rust/reqwest/v1/src/models/port.rs | 2 +- .../reqwest/v1/src/models/port_mapping.rs | 2 +- .../v1/src/models/preemption_config.rs | 2 +- .../rust/reqwest/v1/src/models/quota_limit.rs | 2 +- .../rust/reqwest/v1/src/models/quota_spec.rs | 2 +- .../v1/src/models/raft_configuration.rs | 2 +- .../rust/reqwest/v1/src/models/raft_server.rs | 2 +- .../reqwest/v1/src/models/requested_device.rs | 2 +- .../reqwest/v1/src/models/reschedule_event.rs | 2 +- .../v1/src/models/reschedule_policy.rs | 2 +- .../v1/src/models/reschedule_tracker.rs | 2 +- .../rust/reqwest/v1/src/models/resources.rs | 2 +- .../reqwest/v1/src/models/restart_policy.rs | 2 +- .../reqwest/v1/src/models/sampled_value.rs | 2 +- .../reqwest/v1/src/models/scaling_event.rs | 2 +- .../reqwest/v1/src/models/scaling_policy.rs | 2 +- .../v1/src/models/scaling_policy_list_stub.rs | 2 +- .../reqwest/v1/src/models/scaling_request.rs | 2 +- .../v1/src/models/scheduler_configuration.rs | 2 +- .../scheduler_configuration_response.rs | 2 +- .../scheduler_set_configuration_response.rs | 2 +- .../reqwest/v1/src/models/search_request.rs | 2 +- .../reqwest/v1/src/models/search_response.rs | 2 +- .../reqwest/v1/src/models/server_health.rs | 2 +- clients/rust/reqwest/v1/src/models/service.rs | 2 +- .../reqwest/v1/src/models/service_check.rs | 2 +- .../v1/src/models/service_registration.rs | 2 +- .../reqwest/v1/src/models/sidecar_task.rs | 2 +- clients/rust/reqwest/v1/src/models/spread.rs | 2 +- .../reqwest/v1/src/models/spread_target.rs | 2 +- clients/rust/reqwest/v1/src/models/task.rs | 2 +- .../reqwest/v1/src/models/task_artifact.rs | 2 +- .../v1/src/models/task_csi_plugin_config.rs | 2 +- .../rust/reqwest/v1/src/models/task_diff.rs | 2 +- .../rust/reqwest/v1/src/models/task_event.rs | 2 +- .../rust/reqwest/v1/src/models/task_group.rs | 2 +- .../reqwest/v1/src/models/task_group_diff.rs | 2 +- .../v1/src/models/task_group_scale_status.rs | 2 +- .../v1/src/models/task_group_summary.rs | 2 +- .../rust/reqwest/v1/src/models/task_handle.rs | 2 +- .../reqwest/v1/src/models/task_lifecycle.rs | 2 +- .../rust/reqwest/v1/src/models/task_state.rs | 2 +- .../rust/reqwest/v1/src/models/template.rs | 2 +- .../reqwest/v1/src/models/update_strategy.rs | 2 +- clients/rust/reqwest/v1/src/models/vault.rs | 2 +- .../reqwest/v1/src/models/volume_mount.rs | 2 +- .../reqwest/v1/src/models/volume_request.rs | 2 +- .../rust/reqwest/v1/src/models/wait_config.rs | 2 +- .../typescript/v1/.openapi-generator/FILES | 17 + .../typescript/v1/.openapi-generator/VERSION | 2 +- clients/typescript/v1/ACLApi.md | 935 ++ clients/typescript/v1/AllocationsApi.md | 355 + clients/typescript/v1/DeploymentsApi.md | 654 ++ clients/typescript/v1/EnterpriseApi.md | 543 + clients/typescript/v1/EvaluationsApi.md | 261 + clients/typescript/v1/JobsApi.md | 5471 +++++++++ clients/typescript/v1/MetricsApi.md | 67 + clients/typescript/v1/NamespacesApi.md | 403 + clients/typescript/v1/NodesApi.md | 538 + clients/typescript/v1/OperatorApi.md | 567 + clients/typescript/v1/PluginsApi.md | 176 + clients/typescript/v1/README.md | 2 +- clients/typescript/v1/RegionsApi.md | 61 + clients/typescript/v1/ScalingApi.md | 176 + clients/typescript/v1/SearchApi.md | 218 + clients/typescript/v1/StatusApi.md | 173 + clients/typescript/v1/SystemApi.md | 143 + clients/typescript/v1/VolumesApi.md | 9996 +++++++++++++++++ clients/typescript/v1/apis/ACLApi.ts | 430 +- clients/typescript/v1/apis/AllocationsApi.ts | 180 +- clients/typescript/v1/apis/DeploymentsApi.ts | 292 +- clients/typescript/v1/apis/EnterpriseApi.ts | 199 +- clients/typescript/v1/apis/EvaluationsApi.ts | 132 +- clients/typescript/v1/apis/JobsApi.ts | 772 +- clients/typescript/v1/apis/MetricsApi.ts | 36 +- clients/typescript/v1/apis/NamespacesApi.ts | 184 +- clients/typescript/v1/apis/NodesApi.ts | 260 +- clients/typescript/v1/apis/OperatorApi.ts | 258 +- clients/typescript/v1/apis/PluginsApi.ts | 90 +- clients/typescript/v1/apis/RegionsApi.ts | 38 +- clients/typescript/v1/apis/ScalingApi.ts | 90 +- clients/typescript/v1/apis/SearchApi.ts | 88 +- clients/typescript/v1/apis/StatusApi.ts | 88 +- clients/typescript/v1/apis/SystemApi.ts | 68 +- clients/typescript/v1/apis/VolumesApi.ts | 410 +- clients/typescript/v1/apis/baseapi.ts | 8 +- clients/typescript/v1/apis/exception.ts | 7 +- clients/typescript/v1/auth/auth.ts | 4 +- clients/typescript/v1/http/http.ts | 22 +- clients/typescript/v1/index.ts | 1 + clients/typescript/v1/middleware.ts | 2 +- clients/typescript/v1/models/ACLPolicy.ts | 2 +- .../typescript/v1/models/ACLPolicyListStub.ts | 2 +- clients/typescript/v1/models/ACLToken.ts | 2 +- .../typescript/v1/models/ACLTokenListStub.ts | 2 +- clients/typescript/v1/models/Affinity.ts | 2 +- .../v1/models/AllocDeploymentStatus.ts | 2 +- .../typescript/v1/models/AllocStopResponse.ts | 2 +- .../v1/models/AllocatedCpuResources.ts | 2 +- .../v1/models/AllocatedDeviceResource.ts | 2 +- .../v1/models/AllocatedMemoryResources.ts | 2 +- .../v1/models/AllocatedResources.ts | 2 +- .../v1/models/AllocatedSharedResources.ts | 2 +- .../v1/models/AllocatedTaskResources.ts | 2 +- clients/typescript/v1/models/Allocation.ts | 2 +- .../v1/models/AllocationListStub.ts | 2 +- .../typescript/v1/models/AllocationMetric.ts | 2 +- clients/typescript/v1/models/Attribute.ts | 2 +- .../v1/models/AutopilotConfiguration.ts | 2 +- .../typescript/v1/models/CSIControllerInfo.ts | 2 +- clients/typescript/v1/models/CSIInfo.ts | 2 +- .../typescript/v1/models/CSIMountOptions.ts | 2 +- clients/typescript/v1/models/CSINodeInfo.ts | 2 +- clients/typescript/v1/models/CSIPlugin.ts | 2 +- .../typescript/v1/models/CSIPluginListStub.ts | 2 +- clients/typescript/v1/models/CSISnapshot.ts | 2 +- .../v1/models/CSISnapshotCreateRequest.ts | 2 +- .../v1/models/CSISnapshotCreateResponse.ts | 2 +- .../v1/models/CSISnapshotListResponse.ts | 2 +- clients/typescript/v1/models/CSITopology.ts | 2 +- .../v1/models/CSITopologyRequest.ts | 2 +- clients/typescript/v1/models/CSIVolume.ts | 2 +- .../v1/models/CSIVolumeCapability.ts | 2 +- .../v1/models/CSIVolumeCreateRequest.ts | 2 +- .../v1/models/CSIVolumeExternalStub.ts | 2 +- .../models/CSIVolumeListExternalResponse.ts | 2 +- .../typescript/v1/models/CSIVolumeListStub.ts | 2 +- .../v1/models/CSIVolumeRegisterRequest.ts | 2 +- clients/typescript/v1/models/CheckRestart.ts | 2 +- clients/typescript/v1/models/Constraint.ts | 2 +- clients/typescript/v1/models/Consul.ts | 2 +- clients/typescript/v1/models/ConsulConnect.ts | 2 +- .../v1/models/ConsulExposeConfig.ts | 2 +- .../typescript/v1/models/ConsulExposePath.ts | 2 +- clients/typescript/v1/models/ConsulGateway.ts | 7 +- .../v1/models/ConsulGatewayBindAddress.ts | 2 +- .../v1/models/ConsulGatewayProxy.ts | 7 +- .../v1/models/ConsulGatewayTLSConfig.ts | 2 +- .../v1/models/ConsulIngressConfigEntry.ts | 2 +- .../v1/models/ConsulIngressListener.ts | 2 +- .../v1/models/ConsulIngressService.ts | 2 +- .../v1/models/ConsulLinkedService.ts | 2 +- .../typescript/v1/models/ConsulMeshGateway.ts | 2 +- clients/typescript/v1/models/ConsulProxy.ts | 7 +- .../v1/models/ConsulSidecarService.ts | 2 +- .../v1/models/ConsulTerminatingConfigEntry.ts | 2 +- .../typescript/v1/models/ConsulUpstream.ts | 2 +- clients/typescript/v1/models/DNSConfig.ts | 2 +- clients/typescript/v1/models/Deployment.ts | 2 +- .../v1/models/DeploymentAllocHealthRequest.ts | 2 +- .../v1/models/DeploymentPauseRequest.ts | 2 +- .../v1/models/DeploymentPromoteRequest.ts | 2 +- .../typescript/v1/models/DeploymentState.ts | 2 +- .../v1/models/DeploymentUnblockRequest.ts | 2 +- .../v1/models/DeploymentUpdateResponse.ts | 2 +- .../typescript/v1/models/DesiredTransition.ts | 2 +- .../typescript/v1/models/DesiredUpdates.ts | 2 +- .../v1/models/DispatchPayloadConfig.ts | 2 +- clients/typescript/v1/models/DrainMetadata.ts | 2 +- clients/typescript/v1/models/DrainSpec.ts | 2 +- clients/typescript/v1/models/DrainStrategy.ts | 2 +- clients/typescript/v1/models/DriverInfo.ts | 2 +- clients/typescript/v1/models/EphemeralDisk.ts | 2 +- clients/typescript/v1/models/EvalOptions.ts | 2 +- clients/typescript/v1/models/Evaluation.ts | 2 +- .../typescript/v1/models/EvaluationStub.ts | 2 +- clients/typescript/v1/models/FieldDiff.ts | 2 +- clients/typescript/v1/models/FuzzyMatch.ts | 2 +- .../v1/models/FuzzySearchRequest.ts | 2 +- .../v1/models/FuzzySearchResponse.ts | 2 +- clients/typescript/v1/models/GaugeValue.ts | 2 +- .../typescript/v1/models/HostNetworkInfo.ts | 2 +- .../typescript/v1/models/HostVolumeInfo.ts | 2 +- clients/typescript/v1/models/Job.ts | 2 +- .../v1/models/JobChildrenSummary.ts | 2 +- .../v1/models/JobDeregisterResponse.ts | 2 +- clients/typescript/v1/models/JobDiff.ts | 2 +- .../v1/models/JobDispatchRequest.ts | 2 +- .../v1/models/JobDispatchResponse.ts | 2 +- .../v1/models/JobEvaluateRequest.ts | 2 +- clients/typescript/v1/models/JobListStub.ts | 2 +- .../typescript/v1/models/JobPlanRequest.ts | 2 +- .../typescript/v1/models/JobPlanResponse.ts | 2 +- .../v1/models/JobRegisterRequest.ts | 2 +- .../v1/models/JobRegisterResponse.ts | 2 +- .../typescript/v1/models/JobRevertRequest.ts | 2 +- .../v1/models/JobScaleStatusResponse.ts | 2 +- .../v1/models/JobStabilityRequest.ts | 2 +- .../v1/models/JobStabilityResponse.ts | 2 +- clients/typescript/v1/models/JobSummary.ts | 2 +- .../v1/models/JobValidateRequest.ts | 2 +- .../v1/models/JobValidateResponse.ts | 2 +- .../v1/models/JobVersionsResponse.ts | 2 +- .../typescript/v1/models/JobsParseRequest.ts | 2 +- clients/typescript/v1/models/LogConfig.ts | 2 +- .../typescript/v1/models/MetricsSummary.ts | 2 +- .../typescript/v1/models/MigrateStrategy.ts | 2 +- clients/typescript/v1/models/Multiregion.ts | 2 +- .../typescript/v1/models/MultiregionRegion.ts | 2 +- .../v1/models/MultiregionStrategy.ts | 2 +- clients/typescript/v1/models/Namespace.ts | 2 +- .../v1/models/NamespaceCapabilities.ts | 2 +- .../typescript/v1/models/NetworkResource.ts | 2 +- clients/typescript/v1/models/Node.ts | 2 +- .../typescript/v1/models/NodeCpuResources.ts | 2 +- clients/typescript/v1/models/NodeDevice.ts | 2 +- .../v1/models/NodeDeviceLocality.ts | 2 +- .../v1/models/NodeDeviceResource.ts | 2 +- .../typescript/v1/models/NodeDiskResources.ts | 2 +- .../v1/models/NodeDrainUpdateResponse.ts | 2 +- .../models/NodeEligibilityUpdateResponse.ts | 2 +- clients/typescript/v1/models/NodeEvent.ts | 2 +- clients/typescript/v1/models/NodeListStub.ts | 2 +- .../v1/models/NodeMemoryResources.ts | 2 +- .../typescript/v1/models/NodePurgeResponse.ts | 2 +- .../v1/models/NodeReservedCpuResources.ts | 2 +- .../v1/models/NodeReservedDiskResources.ts | 2 +- .../v1/models/NodeReservedMemoryResources.ts | 2 +- .../v1/models/NodeReservedNetworkResources.ts | 2 +- .../v1/models/NodeReservedResources.ts | 2 +- clients/typescript/v1/models/NodeResources.ts | 2 +- clients/typescript/v1/models/NodeScoreMeta.ts | 2 +- .../v1/models/NodeUpdateDrainRequest.ts | 2 +- .../v1/models/NodeUpdateEligibilityRequest.ts | 2 +- clients/typescript/v1/models/ObjectDiff.ts | 2 +- .../typescript/v1/models/ObjectSerializer.ts | 12 +- clients/typescript/v1/models/OneTimeToken.ts | 2 +- .../v1/models/OneTimeTokenExchangeRequest.ts | 2 +- .../v1/models/OperatorHealthReply.ts | 2 +- .../v1/models/ParameterizedJobConfig.ts | 2 +- .../typescript/v1/models/PeriodicConfig.ts | 2 +- .../v1/models/PeriodicForceResponse.ts | 2 +- .../typescript/v1/models/PlanAnnotations.ts | 2 +- clients/typescript/v1/models/PointValue.ts | 2 +- clients/typescript/v1/models/Port.ts | 2 +- clients/typescript/v1/models/PortMapping.ts | 2 +- .../typescript/v1/models/PreemptionConfig.ts | 2 +- clients/typescript/v1/models/QuotaLimit.ts | 2 +- clients/typescript/v1/models/QuotaSpec.ts | 2 +- .../typescript/v1/models/RaftConfiguration.ts | 2 +- clients/typescript/v1/models/RaftServer.ts | 2 +- .../typescript/v1/models/RequestedDevice.ts | 2 +- .../typescript/v1/models/RescheduleEvent.ts | 2 +- .../typescript/v1/models/ReschedulePolicy.ts | 2 +- .../typescript/v1/models/RescheduleTracker.ts | 2 +- clients/typescript/v1/models/Resources.ts | 2 +- clients/typescript/v1/models/RestartPolicy.ts | 2 +- clients/typescript/v1/models/SampledValue.ts | 2 +- clients/typescript/v1/models/ScalingEvent.ts | 7 +- clients/typescript/v1/models/ScalingPolicy.ts | 7 +- .../v1/models/ScalingPolicyListStub.ts | 2 +- .../typescript/v1/models/ScalingRequest.ts | 7 +- .../v1/models/SchedulerConfiguration.ts | 2 +- .../models/SchedulerConfigurationResponse.ts | 2 +- .../SchedulerSetConfigurationResponse.ts | 2 +- clients/typescript/v1/models/SearchRequest.ts | 2 +- .../typescript/v1/models/SearchResponse.ts | 2 +- clients/typescript/v1/models/ServerHealth.ts | 2 +- clients/typescript/v1/models/Service.ts | 2 +- clients/typescript/v1/models/ServiceCheck.ts | 2 +- .../v1/models/ServiceRegistration.ts | 2 +- clients/typescript/v1/models/SidecarTask.ts | 7 +- clients/typescript/v1/models/Spread.ts | 2 +- clients/typescript/v1/models/SpreadTarget.ts | 2 +- clients/typescript/v1/models/Task.ts | 7 +- clients/typescript/v1/models/TaskArtifact.ts | 2 +- .../v1/models/TaskCSIPluginConfig.ts | 2 +- clients/typescript/v1/models/TaskDiff.ts | 2 +- clients/typescript/v1/models/TaskEvent.ts | 2 +- clients/typescript/v1/models/TaskGroup.ts | 2 +- clients/typescript/v1/models/TaskGroupDiff.ts | 2 +- .../v1/models/TaskGroupScaleStatus.ts | 2 +- .../typescript/v1/models/TaskGroupSummary.ts | 2 +- clients/typescript/v1/models/TaskHandle.ts | 2 +- clients/typescript/v1/models/TaskLifecycle.ts | 2 +- clients/typescript/v1/models/TaskState.ts | 2 +- clients/typescript/v1/models/Template.ts | 2 +- .../typescript/v1/models/UpdateStrategy.ts | 2 +- clients/typescript/v1/models/Vault.ts | 2 +- clients/typescript/v1/models/VolumeMount.ts | 2 +- clients/typescript/v1/models/VolumeRequest.ts | 2 +- clients/typescript/v1/models/WaitConfig.ts | 2 +- clients/typescript/v1/package.json | 11 +- clients/typescript/v1/tsconfig.json | 3 +- clients/typescript/v1/types/ObjectParamAPI.ts | 60 +- clients/typescript/v1/types/ObservableAPI.ts | 190 +- clients/typescript/v1/types/PromiseAPI.ts | 2 +- clients/typescript/v1/util.ts | 11 +- generator/go.mod | 5 +- generator/go.sum | 5 +- generator/specbuilder.go | 33 +- generator/specbuilder_test.go | 26 + v1/openapi.yaml | 203 +- 2339 files changed, 83477 insertions(+), 26940 deletions(-) create mode 100644 clients/java/v1/.github/workflows/maven.yml create mode 100644 clients/java/v1/src/main/java/io/nomadproject/client/models/AbstractOpenApiSchema.java create mode 100644 clients/typescript/v1/ACLApi.md create mode 100644 clients/typescript/v1/AllocationsApi.md create mode 100644 clients/typescript/v1/DeploymentsApi.md create mode 100644 clients/typescript/v1/EnterpriseApi.md create mode 100644 clients/typescript/v1/EvaluationsApi.md create mode 100644 clients/typescript/v1/JobsApi.md create mode 100644 clients/typescript/v1/MetricsApi.md create mode 100644 clients/typescript/v1/NamespacesApi.md create mode 100644 clients/typescript/v1/NodesApi.md create mode 100644 clients/typescript/v1/OperatorApi.md create mode 100644 clients/typescript/v1/PluginsApi.md create mode 100644 clients/typescript/v1/RegionsApi.md create mode 100644 clients/typescript/v1/ScalingApi.md create mode 100644 clients/typescript/v1/SearchApi.md create mode 100644 clients/typescript/v1/StatusApi.md create mode 100644 clients/typescript/v1/SystemApi.md create mode 100644 clients/typescript/v1/VolumesApi.md diff --git a/Makefile b/Makefile index 80f9e239..bbcdfe13 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -VERSION=v5.2.0 -DOCKER_IMAGE="openapitools/openapi-generator-cli:$(VERSION)" +OPENAPI_GEN_VERSION=v6.0.0 +DOCKER_IMAGE="openapitools/openapi-generator-cli:$(OPENAPI_GEN_VERSION)" THIS_OS := $(shell go env GOOS) CGO_ENABLED = 1 diff --git a/clients/go/v1/.openapi-generator/VERSION b/clients/go/v1/.openapi-generator/VERSION index 7cbea073..f4965a31 100644 --- a/clients/go/v1/.openapi-generator/VERSION +++ b/clients/go/v1/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0 \ No newline at end of file +6.0.0 \ No newline at end of file diff --git a/clients/go/v1/README.md b/clients/go/v1/README.md index 12ca7b70..39079933 100644 --- a/clients/go/v1/README.md +++ b/clients/go/v1/README.md @@ -22,7 +22,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./client" +import client "github.com/hashicorp/nomad-openapi/clients/go/v1" ``` To use a proxy, set the environment variable `HTTP_PROXY`: @@ -40,7 +40,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +ctx := context.WithValue(context.Background(), client.ContextServerIndex, 1) ``` ### Templated Server URL @@ -48,7 +48,7 @@ ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -58,14 +58,14 @@ Note, enum values are always validated and all unused variables are silently ign ### URLs Configuration per Operation Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. ``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), client.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, diff --git a/clients/go/v1/api/openapi.yaml b/clients/go/v1/api/openapi.yaml index 32ec720d..95644126 100644 --- a/clients/go/v1/api/openapi.yaml +++ b/clients/go/v1/api/openapi.yaml @@ -9,7 +9,7 @@ info: version: 1.1.4 servers: - description: dev-agent - url: '{scheme}://{address}:{port}/v1' + url: "{scheme}://{address}:{port}/v1" variables: address: default: 127.0.0.1 @@ -21,7 +21,7 @@ servers: - https - http - description: agent - url: '{scheme}://{address}:{port}/v1' + url: "{scheme}://{address}:{port}/v1" variables: address: default: 127.0.0.1 @@ -77,6 +77,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -118,8 +119,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -135,7 +136,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -183,6 +184,7 @@ paths: items: $ref: '#/components/schemas/ACLPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -263,6 +265,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -303,8 +306,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -320,7 +323,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -374,6 +377,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -459,6 +463,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -500,8 +505,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -517,7 +522,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -563,6 +568,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -643,6 +649,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -683,8 +690,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -700,7 +707,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -754,6 +761,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -843,6 +851,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -906,6 +915,7 @@ paths: application/json: schema: $ref: '#/components/schemas/OneTimeToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -975,6 +985,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1016,8 +1027,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1033,7 +1044,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1081,6 +1092,7 @@ paths: items: $ref: '#/components/schemas/ACLTokenListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1135,8 +1147,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1152,7 +1164,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1206,6 +1218,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Allocation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1260,8 +1273,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1277,7 +1290,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1333,6 +1346,7 @@ paths: items: $ref: '#/components/schemas/ServiceRegistration' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1387,8 +1401,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1404,7 +1418,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1467,6 +1481,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AllocStopResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1508,8 +1523,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1525,7 +1540,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1589,6 +1604,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1643,8 +1659,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1660,7 +1676,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1714,6 +1730,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1804,6 +1821,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -1836,8 +1854,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1853,7 +1871,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1909,6 +1927,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1993,6 +2012,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2061,6 +2081,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2129,6 +2150,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2197,6 +2219,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2229,8 +2252,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2246,7 +2269,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2294,6 +2317,7 @@ paths: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2348,8 +2372,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2365,7 +2389,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2419,6 +2443,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Evaluation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2473,8 +2498,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2490,7 +2515,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2546,6 +2571,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2600,8 +2626,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2617,7 +2643,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2665,6 +2691,7 @@ paths: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2767,6 +2794,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobDeregisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2807,8 +2835,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2824,7 +2852,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2878,6 +2906,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Job' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2967,6 +2996,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3021,8 +3051,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3038,7 +3068,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3104,6 +3134,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3158,8 +3189,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3175,7 +3206,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3229,6 +3260,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3283,8 +3315,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3300,7 +3332,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3365,6 +3397,7 @@ paths: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3455,6 +3488,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobDispatchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3532,6 +3566,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3573,8 +3608,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3590,7 +3625,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3646,6 +3681,7 @@ paths: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3730,6 +3766,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PeriodicForceResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3807,6 +3844,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobPlanResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3884,6 +3922,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3925,8 +3964,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3942,7 +3981,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3996,6 +4035,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobScaleStatusResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4085,6 +4125,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4162,6 +4203,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobStabilityResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4203,8 +4245,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4220,7 +4262,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4274,6 +4316,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobSummary' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4328,8 +4371,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4345,7 +4388,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4407,6 +4450,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobVersionsResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4461,8 +4505,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4478,7 +4522,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4526,6 +4570,7 @@ paths: items: $ref: '#/components/schemas/JobListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4607,6 +4652,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4656,6 +4702,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Job' + description: "" "400": description: Bad request "403": @@ -4684,6 +4731,7 @@ paths: application/json: schema: $ref: '#/components/schemas/MetricsSummary' + description: "" "400": description: Bad request "403": @@ -4732,6 +4780,7 @@ paths: style: form responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4799,6 +4848,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4839,8 +4889,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4856,7 +4906,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4910,6 +4960,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Namespace' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4995,6 +5046,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5036,8 +5088,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5053,7 +5105,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5101,6 +5153,7 @@ paths: items: $ref: '#/components/schemas/Namespace' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5155,8 +5208,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5172,7 +5225,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5226,6 +5279,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Node' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5280,8 +5334,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5297,7 +5351,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5353,6 +5407,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5407,8 +5462,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5424,7 +5479,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5484,6 +5539,7 @@ paths: application/json: schema: $ref: '#/components/schemas/NodeDrainUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5525,8 +5581,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5542,7 +5598,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5602,6 +5658,7 @@ paths: application/json: schema: $ref: '#/components/schemas/NodeEligibilityUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5643,8 +5700,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5660,7 +5717,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5714,6 +5771,7 @@ paths: application/json: schema: $ref: '#/components/schemas/NodePurgeResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5755,8 +5813,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5772,7 +5830,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5829,6 +5887,7 @@ paths: items: $ref: '#/components/schemas/NodeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5883,8 +5942,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5900,7 +5959,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5946,6 +6005,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AutopilotConfiguration' + description: "" "400": description: Bad request "403": @@ -6005,6 +6065,7 @@ paths: application/json: schema: type: boolean + description: "" "400": description: Bad request "403": @@ -6037,8 +6098,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6054,7 +6115,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6100,6 +6161,7 @@ paths: application/json: schema: $ref: '#/components/schemas/OperatorHealthReply' + description: "" "400": description: Bad request "403": @@ -6132,8 +6194,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6149,7 +6211,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6195,6 +6257,7 @@ paths: application/json: schema: $ref: '#/components/schemas/RaftConfiguration' + description: "" "400": description: Bad request "403": @@ -6244,7 +6307,8 @@ paths: type: string style: form responses: - "200": {} + "200": + description: "" "400": description: Bad request "403": @@ -6277,8 +6341,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6294,7 +6358,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6340,6 +6404,7 @@ paths: application/json: schema: $ref: '#/components/schemas/SchedulerConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6421,6 +6486,7 @@ paths: application/json: schema: $ref: '#/components/schemas/SchedulerSetConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6462,8 +6528,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6479,7 +6545,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6535,6 +6601,7 @@ paths: items: $ref: '#/components/schemas/CSIPlugin' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6589,8 +6656,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6606,7 +6673,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6654,6 +6721,7 @@ paths: items: $ref: '#/components/schemas/CSIPluginListStub' type: array + description: "" "400": description: Bad request "403": @@ -6710,6 +6778,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6777,6 +6846,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6817,8 +6887,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6834,7 +6904,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6888,6 +6958,7 @@ paths: application/json: schema: $ref: '#/components/schemas/QuotaSpec' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6973,6 +7044,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7014,8 +7086,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7031,7 +7103,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7078,6 +7150,7 @@ paths: schema: items: {} type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7123,6 +7196,7 @@ paths: items: type: string type: array + description: "" "400": description: Bad request "403": @@ -7153,8 +7227,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7170,7 +7244,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7218,6 +7292,7 @@ paths: items: $ref: '#/components/schemas/ScalingPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7272,8 +7347,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7289,7 +7364,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7343,6 +7418,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ScalingPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7397,8 +7473,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7414,7 +7490,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7466,6 +7542,7 @@ paths: application/json: schema: $ref: '#/components/schemas/SearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7520,8 +7597,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7537,7 +7614,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7589,6 +7666,7 @@ paths: application/json: schema: $ref: '#/components/schemas/FuzzySearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7643,8 +7721,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7660,7 +7738,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7706,6 +7784,7 @@ paths: application/json: schema: type: string + description: "" "400": description: Bad request "403": @@ -7738,8 +7817,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7755,7 +7834,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7803,6 +7882,7 @@ paths: items: type: string type: array + description: "" "400": description: Bad request "403": @@ -7852,7 +7932,8 @@ paths: type: string style: form responses: - "200": {} + "200": + description: "" "400": description: Bad request "403": @@ -7902,7 +7983,8 @@ paths: type: string style: form responses: - "200": {} + "200": + description: "" "400": description: Bad request "403": @@ -7963,6 +8045,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobValidateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8038,6 +8121,7 @@ paths: style: form responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8078,8 +8162,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8095,7 +8179,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8149,6 +8233,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSIVolume' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8234,6 +8319,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8307,7 +8393,7 @@ paths: schema: type: string style: form - - description: The action to perform on the Volume (create, detach, delete). + - description: "The action to perform on the Volume (create, detach, delete)." explode: false in: path name: action @@ -8317,6 +8403,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8394,7 +8481,7 @@ paths: schema: type: string style: simple - - description: The action to perform on the Volume (create, detach, delete). + - description: "The action to perform on the Volume (create, detach, delete)." explode: false in: path name: action @@ -8410,6 +8497,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8464,8 +8552,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8481,7 +8569,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8553,6 +8641,7 @@ paths: items: $ref: '#/components/schemas/CSIVolumeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8630,6 +8719,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8684,8 +8774,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8701,7 +8791,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8755,6 +8845,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSIVolumeListExternalResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8843,6 +8934,7 @@ paths: style: form responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8883,8 +8975,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8900,7 +8992,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8954,6 +9046,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSISnapshotListResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -9035,6 +9128,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSISnapshotCreateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -9150,8 +9244,8 @@ components: type: string style: form IndexHeader: - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -9336,7 +9430,7 @@ components: type: string style: form StaleParam: - description: If present, results will include stale reads. + description: "If present, results will include stale reads." explode: true in: query name: stale @@ -9345,7 +9439,7 @@ components: type: string style: form VolumeActionParam: - description: The action to perform on the Volume (create, detach, delete). + description: "The action to perform on the Volume (create, detach, delete)." explode: false in: path name: action @@ -9583,6 +9677,7 @@ components: BadRequestResponse: description: Bad request CreateNamespaceResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9592,6 +9687,7 @@ components: type: integer style: simple CreateQuotaSpecResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9601,6 +9697,7 @@ components: type: integer style: simple DeleteACLPolicyResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9610,6 +9707,7 @@ components: type: integer style: simple DeleteACLTokenResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9623,6 +9721,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobDeregisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9632,6 +9731,7 @@ components: type: integer style: simple DeleteNamespaceResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9640,8 +9740,10 @@ components: schema: type: integer style: simple - DeleteOperatorRaftPeerResponse: {} + DeleteOperatorRaftPeerResponse: + description: "" DeleteSnapshotResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9651,6 +9753,7 @@ components: type: integer style: simple DeleteVolumeRegistrationResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9660,6 +9763,7 @@ components: type: integer style: simple DetachOrDeleteVolumeResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9690,6 +9794,7 @@ components: items: $ref: '#/components/schemas/ACLPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9716,6 +9821,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9742,6 +9848,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9768,6 +9875,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9796,6 +9904,7 @@ components: items: $ref: '#/components/schemas/ACLTokenListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9822,6 +9931,7 @@ components: application/json: schema: $ref: '#/components/schemas/Allocation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9850,6 +9960,7 @@ components: items: $ref: '#/components/schemas/ServiceRegistration' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9878,6 +9989,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9906,6 +10018,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9932,6 +10045,7 @@ components: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9960,6 +10074,7 @@ components: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9988,6 +10103,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10014,6 +10130,7 @@ components: application/json: schema: $ref: '#/components/schemas/Evaluation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10042,6 +10159,7 @@ components: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10068,6 +10186,7 @@ components: application/json: schema: $ref: '#/components/schemas/CSIVolumeListExternalResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10094,6 +10213,7 @@ components: application/json: schema: $ref: '#/components/schemas/FuzzySearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10122,6 +10242,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10148,6 +10269,7 @@ components: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10176,6 +10298,7 @@ components: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10204,6 +10327,7 @@ components: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10230,6 +10354,7 @@ components: application/json: schema: $ref: '#/components/schemas/Job' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10256,6 +10381,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobScaleStatusResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10282,6 +10408,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobSummary' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10308,6 +10435,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobVersionsResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10336,6 +10464,7 @@ components: items: $ref: '#/components/schemas/JobListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10362,11 +10491,13 @@ components: application/json: schema: $ref: '#/components/schemas/MetricsSummary' + description: "" GetNamespaceResponse: content: application/json: schema: $ref: '#/components/schemas/Namespace' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10395,6 +10526,7 @@ components: items: $ref: '#/components/schemas/Namespace' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10423,6 +10555,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10449,6 +10582,7 @@ components: application/json: schema: $ref: '#/components/schemas/Node' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10477,6 +10611,7 @@ components: items: $ref: '#/components/schemas/NodeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10503,21 +10638,25 @@ components: application/json: schema: $ref: '#/components/schemas/AutopilotConfiguration' + description: "" GetOperatorAutopilotHealthResponse: content: application/json: schema: $ref: '#/components/schemas/OperatorHealthReply' + description: "" GetOperatorRaftConfigurationResponse: content: application/json: schema: $ref: '#/components/schemas/RaftConfiguration' + description: "" GetOperatorSchedulerConfigurationResponse: content: application/json: schema: $ref: '#/components/schemas/SchedulerConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10546,6 +10685,7 @@ components: items: $ref: '#/components/schemas/CSIPlugin' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10574,11 +10714,13 @@ components: items: $ref: '#/components/schemas/CSIPluginListStub' type: array + description: "" GetQuotaSpecResponse: content: application/json: schema: $ref: '#/components/schemas/QuotaSpec' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10606,6 +10748,7 @@ components: schema: items: {} type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10634,6 +10777,7 @@ components: items: type: string type: array + description: "" GetScalingPoliciesResponse: content: application/json: @@ -10641,6 +10785,7 @@ components: items: $ref: '#/components/schemas/ScalingPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10667,6 +10812,7 @@ components: application/json: schema: $ref: '#/components/schemas/ScalingPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10693,6 +10839,7 @@ components: application/json: schema: $ref: '#/components/schemas/SearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10719,6 +10866,7 @@ components: application/json: schema: $ref: '#/components/schemas/CSISnapshotListResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10745,6 +10893,7 @@ components: application/json: schema: type: string + description: "" GetStatusPeersResponse: content: application/json: @@ -10752,11 +10901,13 @@ components: items: type: string type: array + description: "" GetVolumeResponse: content: application/json: schema: $ref: '#/components/schemas/CSIVolume' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10785,6 +10936,7 @@ components: items: $ref: '#/components/schemas/CSIVolumeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10815,6 +10967,7 @@ components: application/json: schema: $ref: '#/components/schemas/NodeDrainUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10828,6 +10981,7 @@ components: application/json: schema: $ref: '#/components/schemas/NodeEligibilityUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10841,6 +10995,7 @@ components: application/json: schema: $ref: '#/components/schemas/NodePurgeResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10854,6 +11009,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10863,6 +11019,7 @@ components: type: integer style: simple PostACLPolicyResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10876,6 +11033,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10889,6 +11047,7 @@ components: application/json: schema: $ref: '#/components/schemas/OneTimeToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10902,6 +11061,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10915,6 +11075,7 @@ components: application/json: schema: $ref: '#/components/schemas/AllocStopResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10928,31 +11089,37 @@ components: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentFailResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentPauseResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentPromoteResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentUnblockResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostJobDispatchResponse: content: application/json: schema: $ref: '#/components/schemas/JobDispatchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10966,6 +11133,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10979,11 +11147,13 @@ components: application/json: schema: $ref: '#/components/schemas/Job' + description: "" PostJobPeriodicForceResponse: content: application/json: schema: $ref: '#/components/schemas/PeriodicForceResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10997,6 +11167,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobPlanResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11010,6 +11181,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11036,6 +11208,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11049,6 +11222,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11062,6 +11236,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobStabilityResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11075,6 +11250,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobValidateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11084,6 +11260,7 @@ components: type: integer style: simple PostNamespaceResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11097,6 +11274,7 @@ components: application/json: schema: $ref: '#/components/schemas/SchedulerSetConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11106,6 +11284,7 @@ components: type: integer style: simple PostQuotaSpecResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11119,6 +11298,7 @@ components: application/json: schema: $ref: '#/components/schemas/CSISnapshotCreateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11128,6 +11308,7 @@ components: type: integer style: simple PostVolumeRegistrationResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11137,6 +11318,7 @@ components: type: integer style: simple PostVolumeResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11163,13 +11345,17 @@ components: application/json: schema: type: boolean - PutSystemGCResponse: {} - PutSystemReconcileSummariesResponse: {} + description: "" + PutSystemGCResponse: + description: "" + PutSystemReconcileSummariesResponse: + description: "" RegisterJobResponse: content: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11191,7 +11377,8 @@ components: schema: type: integer style: simple - default: {} + default: + description: "" schemas: ACLPolicy: example: @@ -11200,15 +11387,16 @@ components: Rules: Rules ModifyIndex: 2147483647 Name: Name + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11222,15 +11410,16 @@ components: Description: Description ModifyIndex: 2147483647 Name: Name + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11249,20 +11438,22 @@ components: Global: true ModifyIndex: 2147483647 Name: Name + nullable: true properties: AccessorID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: format: date-time + nullable: true type: string Global: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11288,20 +11479,22 @@ components: Global: true ModifyIndex: 2147483647 Name: Name + nullable: true properties: AccessorID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: format: date-time + nullable: true type: string Global: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11319,6 +11512,7 @@ components: RTarget: RTarget Operand: Operand Weight: -101 + nullable: true properties: LTarget: type: string @@ -11337,34 +11531,38 @@ components: Timestamp: 2000-01-23T04:56:07.000+00:00 Healthy: true ModifyIndex: 2147483647 + nullable: true properties: Canary: type: boolean Healthy: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Timestamp: format: date-time + nullable: true type: string type: object AllocStopResponse: example: Index: 2147483647 EvalID: EvalID + nullable: true properties: EvalID: type: string Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object AllocatedCpuResources: example: CpuShares: 9 + nullable: true properties: CpuShares: format: int64 @@ -11378,6 +11576,7 @@ components: Type: Type Vendor: Vendor Name: Name + nullable: true properties: DeviceIDs: items: @@ -11394,6 +11593,7 @@ components: example: MemoryMB: 3 MemoryMaxMB: 2 + nullable: true properties: MemoryMB: format: int64 @@ -11573,6 +11773,7 @@ components: Label: Label Value: 7 To: 2 + nullable: true properties: Shared: $ref: '#/components/schemas/AllocatedSharedResources' @@ -11662,6 +11863,7 @@ components: Label: Label Value: 7 To: 2 + nullable: true properties: DiskMB: format: int64 @@ -11764,6 +11966,7 @@ components: Type: Type Vendor: Vendor Name: Name + nullable: true properties: Cpu: $ref: '#/components/schemas/AllocatedCpuResources' @@ -17632,9 +17835,10 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: AllocModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer AllocatedResources: @@ -17644,7 +17848,7 @@ components: ClientStatus: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -17673,7 +17877,7 @@ components: Metrics: $ref: '#/components/schemas/AllocationMetric' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -17988,6 +18192,7 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: AllocatedResources: $ref: '#/components/schemas/AllocatedResources' @@ -17996,7 +18201,7 @@ components: ClientStatus: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -18019,11 +18224,11 @@ components: JobType: type: string JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -18197,6 +18402,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: AllocationTime: format: int64 @@ -18254,6 +18460,7 @@ components: String: String Unit: Unit Int: 2 + nullable: true properties: Bool: type: boolean @@ -18280,11 +18487,12 @@ components: EnableRedundancyZones: true ModifyIndex: 2147483647 CleanupDeadServers: true + nullable: true properties: CleanupDeadServers: type: boolean CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer DisableUpgradeMigration: @@ -18296,14 +18504,14 @@ components: LastContactThreshold: type: string MaxTrailingLogs: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer MinQuorum: minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ServerStabilizationTime: @@ -18323,6 +18531,7 @@ components: SupportsExpand: true SupportsGet: true SupportsCondition: true + nullable: true properties: SupportsAttachDetach: type: boolean @@ -18381,6 +18590,7 @@ components: SupportsCondition: true Healthy: true RequiresControllerPlugin: true + nullable: true properties: AllocID: type: string @@ -18400,6 +18610,7 @@ components: type: boolean UpdateTime: format: date-time + nullable: true type: string type: object CSIMountOptions: @@ -18408,6 +18619,7 @@ components: - MountFlags - MountFlags FSType: FSType + nullable: true properties: FSType: type: string @@ -18427,6 +18639,7 @@ components: key: Segments SupportsCondition: true SupportsStats: true + nullable: true properties: AccessibleTopology: $ref: '#/components/schemas/CSITopology' @@ -19061,6 +19274,7 @@ components: Version: Version ID: ID ModifyIndex: 2147483647 + nullable: true properties: Allocations: items: @@ -19077,13 +19291,13 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Nodes: @@ -19110,6 +19324,7 @@ components: ID: ID ModifyIndex: 2147483647 Provider: Provider + nullable: true properties: ControllerRequired: type: boolean @@ -19118,13 +19333,13 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NodesExpected: @@ -19154,6 +19369,7 @@ components: SourceVolumeID: SourceVolumeID ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name + nullable: true properties: CreateTime: format: int64 @@ -19212,6 +19428,7 @@ components: ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -19256,6 +19473,7 @@ components: SourceVolumeID: SourceVolumeID ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name + nullable: true properties: KnownLeader: type: boolean @@ -19263,7 +19481,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -19308,6 +19526,7 @@ components: SourceVolumeID: SourceVolumeID ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name + nullable: true properties: KnownLeader: type: boolean @@ -19315,7 +19534,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -19332,6 +19551,7 @@ components: example: Segments: key: Segments + nullable: true properties: Segments: additionalProperties: @@ -19350,6 +19570,7 @@ components: key: Segments - Segments: key: Segments + nullable: true properties: Preferred: items: @@ -31666,6 +31887,7 @@ components: FSType: FSType ModifyIndex: 2147483647 ProviderVersion: ProviderVersion + nullable: true properties: AccessMode: type: string @@ -31691,7 +31913,7 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ExternalID: @@ -31699,7 +31921,7 @@ components: ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer MountOptions: @@ -31740,6 +31962,7 @@ components: $ref: '#/components/schemas/CSITopologyRequest' ResourceExhausted: format: date-time + nullable: true type: string Schedulable: type: boolean @@ -31766,6 +31989,7 @@ components: example: AccessMode: AccessMode AttachmentMode: AttachmentMode + nullable: true properties: AccessMode: type: string @@ -56386,6 +56610,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -56411,6 +56636,7 @@ components: PublishedExternalNodeIDs: - PublishedExternalNodeIDs - PublishedExternalNodeIDs + nullable: true properties: CapacityBytes: format: int64 @@ -56460,6 +56686,7 @@ components: - PublishedExternalNodeIDs - PublishedExternalNodeIDs NextToken: NextToken + nullable: true properties: NextToken: type: string @@ -56492,6 +56719,7 @@ components: ID: ID AttachmentMode: AttachmentMode ModifyIndex: 2147483647 + nullable: true properties: AccessMode: type: string @@ -56504,7 +56732,7 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ExternalID: @@ -56512,7 +56740,7 @@ components: ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -56529,6 +56757,7 @@ components: type: string ResourceExhausted: format: date-time + nullable: true type: string Schedulable: type: boolean @@ -81151,6 +81380,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -81168,6 +81398,7 @@ components: Grace: 0 IgnoreWarnings: true Limit: 4 + nullable: true properties: Grace: format: int64 @@ -81182,6 +81413,7 @@ components: LTarget: LTarget RTarget: RTarget Operand: Operand + nullable: true properties: LTarget: type: string @@ -81193,6 +81425,7 @@ components: Consul: example: Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -81422,6 +81655,7 @@ components: MaxFiles: 4 MaxFileSizeMB: 1 Name: Name + nullable: true properties: Gateway: $ref: '#/components/schemas/ConsulGateway' @@ -81443,6 +81677,7 @@ components: ListenerPort: ListenerPort Protocol: Protocol LocalPathPort: 4 + nullable: true properties: Path: items: @@ -81455,6 +81690,7 @@ components: ListenerPort: ListenerPort Protocol: Protocol LocalPathPort: 4 + nullable: true properties: ListenerPort: type: string @@ -81537,6 +81773,7 @@ components: Address: Address Port: 3 Name: Name + nullable: true properties: Address: type: string @@ -81558,6 +81795,7 @@ components: Address: Address Port: 3 Name: Name + nullable: true properties: Config: additionalProperties: {} @@ -81584,6 +81822,7 @@ components: - CipherSuites - CipherSuites TLSMaxVersion: TLSMaxVersion + nullable: true properties: CipherSuites: items: @@ -81628,6 +81867,7 @@ components: - CipherSuites - CipherSuites TLSMaxVersion: TLSMaxVersion + nullable: true properties: Listeners: items: @@ -81649,6 +81889,7 @@ components: Name: Name Port: 7 Protocol: Protocol + nullable: true properties: Port: type: integer @@ -81665,6 +81906,7 @@ components: - Hosts - Hosts Name: Name + nullable: true properties: Hosts: items: @@ -81680,6 +81922,7 @@ components: KeyFile: KeyFile Name: Name SNI: SNI + nullable: true properties: CAFile: type: string @@ -81696,6 +81939,7 @@ components: ConsulMeshGateway: example: Mode: Mode + nullable: true properties: Mode: type: string @@ -81731,6 +81975,7 @@ components: Mode: Mode LocalBindAddress: LocalBindAddress LocalServicePort: 0 + nullable: true properties: Config: additionalProperties: {} @@ -81783,6 +82028,7 @@ components: Tags: - Tags - Tags + nullable: true properties: DisableDefaultTCPCheck: type: boolean @@ -81808,6 +82054,7 @@ components: KeyFile: KeyFile Name: Name SNI: SNI + nullable: true properties: Services: items: @@ -81823,6 +82070,7 @@ components: MeshGateway: Mode: Mode LocalBindAddress: LocalBindAddress + nullable: true properties: Datacenter: type: string @@ -81850,6 +82098,7 @@ components: Servers: - Servers - Servers + nullable: true properties: Options: items: @@ -81892,9 +82141,10 @@ components: JobVersion: 2147483647 JobID: JobID ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ID: @@ -81902,25 +82152,25 @@ components: IsMultiregion: type: boolean JobCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobSpecModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -81946,6 +82196,7 @@ components: UnhealthyAllocationIDs: - UnhealthyAllocationIDs - UnhealthyAllocationIDs + nullable: true properties: DeploymentID: type: string @@ -81971,6 +82222,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: DeploymentID: type: string @@ -81993,6 +82245,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: All: type: boolean @@ -82023,6 +82276,7 @@ components: - PlacedCanaries UnhealthyAllocs: 7 AutoRevert: true + nullable: true properties: AutoRevert: type: boolean @@ -82045,6 +82299,7 @@ components: type: boolean RequireProgressBy: format: date-time + nullable: true type: string UnhealthyAllocs: type: integer @@ -82055,6 +82310,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: DeploymentID: type: string @@ -82073,26 +82329,27 @@ components: RequestTime: 5 RevertedJobVersion: 2147483647 EvalID: EvalID + nullable: true properties: DeploymentModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: format: int64 type: integer RevertedJobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -82116,43 +82373,45 @@ components: InPlaceUpdate: 2147483647 Place: 2147483647 DestructiveUpdate: 2147483647 + nullable: true properties: Canary: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer DestructiveUpdate: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Ignore: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer InPlaceUpdate: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Migrate: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Place: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Preemptions: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Stop: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object DispatchPayloadConfig: example: File: File + nullable: true properties: File: type: string @@ -82165,6 +82424,7 @@ components: StartedAt: 2000-01-23T04:56:07.000+00:00 UpdatedAt: 2000-01-23T04:56:07.000+00:00 AccessorID: AccessorID + nullable: true properties: AccessorID: type: string @@ -82174,17 +82434,20 @@ components: type: object StartedAt: format: date-time + nullable: true type: string Status: type: string UpdatedAt: format: date-time + nullable: true type: string type: object DrainSpec: example: IgnoreSystemJobs: true Deadline: 0 + nullable: true properties: Deadline: format: int64 @@ -82200,17 +82463,20 @@ components: IgnoreSystemJobs: true Deadline: 1 StartedAt: 2000-01-23T04:56:07.000+00:00 + nullable: true properties: Deadline: format: int64 type: integer ForceDeadline: format: date-time + nullable: true type: string IgnoreSystemJobs: type: boolean StartedAt: format: date-time + nullable: true type: string type: object DriverInfo: @@ -82221,6 +82487,7 @@ components: key: Attributes UpdateTime: 2000-01-23T04:56:07.000+00:00 Healthy: true + nullable: true properties: Attributes: additionalProperties: @@ -82234,6 +82501,7 @@ components: type: boolean UpdateTime: format: date-time + nullable: true type: string type: object Duration: @@ -82255,6 +82523,7 @@ components: EvalOptions: example: ForceReschedule: true + nullable: true properties: ForceReschedule: type: boolean @@ -82472,6 +82741,7 @@ components: Wait: 1 JobID: JobID ModifyIndex: 2147483647 + nullable: true properties: AnnotatePlan: type: boolean @@ -82482,7 +82752,7 @@ components: type: boolean type: object CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -82501,11 +82771,11 @@ components: JobID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -82518,7 +82788,7 @@ components: NodeID: type: string NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer PreviousEval: @@ -82536,7 +82806,7 @@ components: $ref: '#/components/schemas/EvaluationStub' type: array SnapshotIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Status: @@ -82552,6 +82822,7 @@ components: type: integer WaitUntil: format: date-time + nullable: true type: string type: object EvaluationStub: @@ -82574,11 +82845,12 @@ components: WaitUntil: 2000-01-23T04:56:07.000+00:00 JobID: JobID ModifyIndex: 2147483647 + nullable: true properties: BlockedEval: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -82591,7 +82863,7 @@ components: JobID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -82617,6 +82889,7 @@ components: type: string WaitUntil: format: date-time + nullable: true type: string type: object FieldDiff: @@ -82628,6 +82901,7 @@ components: - Annotations Old: Old Name: Name + nullable: true properties: Annotations: items: @@ -82648,6 +82922,7 @@ components: - Scope - Scope ID: ID + nullable: true properties: ID: type: string @@ -82675,6 +82950,7 @@ components: Region: Region WaitTime: 1 AllowStale: true + nullable: true properties: AllowStale: type: boolean @@ -82708,7 +82984,7 @@ components: Text: type: string WaitIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer WaitTime: @@ -82734,6 +83010,7 @@ components: LastIndex: 2147483647 RequestTime: 1 KnownLeader: true + nullable: true properties: KnownLeader: type: boolean @@ -82741,7 +83018,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Matches: @@ -82766,6 +83043,7 @@ components: Labels: key: Labels Name: Name + nullable: true properties: Labels: additionalProperties: @@ -82783,6 +83061,7 @@ components: CIDR: CIDR Interface: Interface Name: Name + nullable: true properties: CIDR: type: string @@ -82797,6 +83076,7 @@ components: example: Path: Path ReadOnly: true + nullable: true properties: Path: type: string @@ -88008,6 +88288,7 @@ components: Payload: Payload ModifyIndex: 2147483647 NomadTokenID: NomadTokenID + nullable: true properties: Affinities: items: @@ -88024,7 +88305,7 @@ components: ConsulToken: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenters: @@ -88038,7 +88319,7 @@ components: ID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Meta: @@ -88048,7 +88329,7 @@ components: Migrate: $ref: '#/components/schemas/MigrateStrategy' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Multiregion: @@ -88102,7 +88383,7 @@ components: VaultToken: type: string Version: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -88111,6 +88392,7 @@ components: Dead: 0 Running: 1 Pending: 6 + nullable: true properties: Dead: format: int64 @@ -88132,15 +88414,16 @@ components: EvalID: EvalID KnownLeader: true JobModifyIndex: 2147483647 + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer KnownLeader: @@ -88149,7 +88432,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -88585,6 +88868,7 @@ components: - null Name: Name ID: ID + nullable: true properties: Fields: items: @@ -88609,6 +88893,7 @@ components: key: Meta Payload: Payload JobID: JobID + nullable: true properties: JobID: type: string @@ -88628,21 +88913,22 @@ components: RequestTime: 5 JobCreateIndex: 2147483647 EvalID: EvalID + nullable: true properties: DispatchedJobID: type: string EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string JobCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -88657,6 +88943,7 @@ components: Region: Region JobID: JobID Namespace: Namespace + nullable: true properties: EvalOptions: $ref: '#/components/schemas/EvalOptions' @@ -88707,9 +88994,10 @@ components: - Datacenters ID: ID ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenters: @@ -88719,13 +89007,13 @@ components: ID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobSummary: $ref: '#/components/schemas/JobSummary' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -93963,6 +94251,7 @@ components: ModifyIndex: 2147483647 NomadTokenID: NomadTokenID Namespace: Namespace + nullable: true properties: Diff: type: boolean @@ -95528,6 +95817,7 @@ components: ModifyIndex: 2147483647 Warnings: Warnings JobModifyIndex: 2147483647 + nullable: true properties: Annotations: $ref: '#/components/schemas/PlanAnnotations' @@ -95542,11 +95832,12 @@ components: $ref: '#/components/schemas/AllocationMetric' type: object JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextPeriodicLaunch: format: date-time + nullable: true type: string Warnings: type: string @@ -100765,6 +101056,7 @@ components: NomadTokenID: NomadTokenID Namespace: Namespace JobModifyIndex: 2147483647 + nullable: true properties: EnforceIndex: type: boolean @@ -100773,7 +101065,7 @@ components: Job: $ref: '#/components/schemas/Job' JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -100798,15 +101090,16 @@ components: KnownLeader: true Warnings: Warnings JobModifyIndex: 2147483647 + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer KnownLeader: @@ -100815,7 +101108,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -100836,17 +101129,18 @@ components: JobID: JobID Namespace: Namespace EnforcePriorVersion: 2147483647 + nullable: true properties: ConsulToken: type: string EnforcePriorVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -100891,15 +101185,16 @@ components: JobID: JobID Namespace: Namespace JobModifyIndex: 2147483647 + nullable: true properties: JobCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobStopped: @@ -100919,11 +101214,12 @@ components: JobVersion: 2147483647 JobID: JobID Namespace: Namespace + nullable: true properties: JobID: type: string JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -100938,9 +101234,10 @@ components: JobStabilityResponse: example: Index: 2147483647 + nullable: true properties: Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -100963,17 +101260,18 @@ components: JobID: JobID ModifyIndex: 2147483647 Namespace: Namespace + nullable: true properties: Children: $ref: '#/components/schemas/JobChildrenSummary' CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -106192,6 +106490,7 @@ components: ModifyIndex: 2147483647 NomadTokenID: NomadTokenID Namespace: Namespace + nullable: true properties: Job: $ref: '#/components/schemas/Job' @@ -106210,6 +106509,7 @@ components: Error: Error DriverConfigValidated: true Warnings: Warnings + nullable: true properties: DriverConfigValidated: type: boolean @@ -117487,6 +117787,7 @@ components: LastIndex: 2147483647 RequestTime: 1 KnownLeader: true + nullable: true properties: Diffs: items: @@ -117498,7 +117799,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -117516,6 +117817,7 @@ components: JobHCL: JobHCL hclv1: true Canonicalize: true + nullable: true properties: Canonicalize: type: boolean @@ -117597,6 +117899,7 @@ components: Labels: key: Labels Name: Name + nullable: true properties: Counters: items: @@ -117655,6 +117958,7 @@ components: - Datacenters Count: 9 Name: Name + nullable: true properties: Regions: items: @@ -117672,6 +117976,7 @@ components: - Datacenters Count: 9 Name: Name + nullable: true properties: Count: type: integer @@ -117712,11 +118017,12 @@ components: - EnabledTaskDrivers ModifyIndex: 2147483647 Name: Name + nullable: true properties: Capabilities: $ref: '#/components/schemas/NamespaceCapabilities' CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: @@ -117726,7 +118032,7 @@ components: type: string type: object ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -117742,6 +118048,7 @@ components: EnabledTaskDrivers: - EnabledTaskDrivers - EnabledTaskDrivers + nullable: true properties: DisabledTaskDrivers: items: @@ -117788,6 +118095,7 @@ components: To: 1 HostNetwork: HostNetwork MBits: 5 + nullable: true properties: CIDR: type: string @@ -118301,6 +118609,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: Attributes: additionalProperties: @@ -118317,7 +118626,7 @@ components: CgroupParent: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenter: @@ -118357,7 +118666,7 @@ components: type: string type: object ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -118391,6 +118700,7 @@ components: - 46276 - 46276 TotalCpuCores: 60957 + nullable: true properties: CpuShares: format: int64 @@ -118413,6 +118723,7 @@ components: PciBusID: PciBusID ID: ID Healthy: true + nullable: true properties: HealthDescription: type: string @@ -118426,6 +118737,7 @@ components: NodeDeviceLocality: example: PciBusID: PciBusID + nullable: true properties: PciBusID: type: string @@ -118453,6 +118765,7 @@ components: Int: 2 Vendor: Vendor Name: Name + nullable: true properties: Attributes: additionalProperties: @@ -118472,6 +118785,7 @@ components: NodeDiskResources: example: DiskMB: 4 + nullable: true properties: DiskMB: format: int64 @@ -118486,9 +118800,10 @@ components: EvalIDs: - EvalIDs - EvalIDs + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalIDs: @@ -118496,11 +118811,11 @@ components: type: string type: array LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -118516,9 +118831,10 @@ components: EvalIDs: - EvalIDs - EvalIDs + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalIDs: @@ -118526,11 +118842,11 @@ components: type: string type: array LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -118545,9 +118861,10 @@ components: Message: Message Subsystem: Subsystem Timestamp: 2000-01-23T04:56:07.000+00:00 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Details: @@ -118560,6 +118877,7 @@ components: type: string Timestamp: format: date-time + nullable: true type: string type: object NodeListStub: @@ -118727,6 +119045,7 @@ components: Datacenter: Datacenter ID: ID ModifyIndex: 2147483647 + nullable: true properties: Address: type: string @@ -118735,7 +119054,7 @@ components: type: string type: object CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenter: @@ -118751,7 +119070,7 @@ components: LastDrain: $ref: '#/components/schemas/DrainMetadata' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -118774,6 +119093,7 @@ components: NodeMemoryResources: example: MemoryMB: 1 + nullable: true properties: MemoryMB: format: int64 @@ -118786,9 +119106,10 @@ components: EvalIDs: - EvalIDs - EvalIDs + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalIDs: @@ -118796,40 +119117,44 @@ components: type: string type: array NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedCpuResources: example: CpuShares: 2147483647 + nullable: true properties: CpuShares: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedDiskResources: example: DiskMB: 2147483647 + nullable: true properties: DiskMB: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedMemoryResources: example: MemoryMB: 2147483647 + nullable: true properties: MemoryMB: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedNetworkResources: example: ReservedHostPorts: ReservedHostPorts + nullable: true properties: ReservedHostPorts: type: string @@ -118844,6 +119169,7 @@ components: CpuShares: 2147483647 Disk: DiskMB: 2147483647 + nullable: true properties: Cpu: $ref: '#/components/schemas/NodeReservedCpuResources' @@ -118980,6 +119306,7 @@ components: Name: Name Disk: DiskMB: 4 + nullable: true properties: Cpu: $ref: '#/components/schemas/NodeCpuResources' @@ -119005,7 +119332,8 @@ components: NormScore: 0.4768402382624515 NodeID: NodeID Scores: - key: 3.1497903714250555 + key: 0.4768402382624515 + nullable: true properties: NodeID: type: string @@ -119027,6 +119355,7 @@ components: key: Meta MarkEligible: true NodeID: NodeID + nullable: true properties: DrainSpec: $ref: '#/components/schemas/DrainSpec' @@ -119043,6 +119372,7 @@ components: example: Eligibility: Eligibility NodeID: NodeID + nullable: true properties: Eligibility: type: string @@ -119071,6 +119401,7 @@ components: - null - null Name: Name + nullable: true properties: Fields: items: @@ -119092,18 +119423,20 @@ components: ExpiresAt: 2000-01-23T04:56:07.000+00:00 AccessorID: AccessorID ModifyIndex: 2147483647 + nullable: true properties: AccessorID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ExpiresAt: format: date-time + nullable: true type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer OneTimeSecretID: @@ -119112,6 +119445,7 @@ components: OneTimeTokenExchangeRequest: example: OneTimeSecretID: OneTimeSecretID + nullable: true properties: OneTimeSecretID: type: string @@ -119145,6 +119479,7 @@ components: LastTerm: 2147483647 Name: Name Healthy: true + nullable: true properties: FailureTolerance: type: integer @@ -119164,6 +119499,7 @@ components: MetaRequired: - MetaRequired - MetaRequired + nullable: true properties: MetaOptional: items: @@ -119200,15 +119536,16 @@ components: EvalCreateIndex: 2147483647 Index: 2147483647 EvalID: EvalID + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -119765,6 +120102,7 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: DesiredTGUpdates: additionalProperties: @@ -119781,6 +120119,7 @@ components: - 3.6160767 - 3.6160767 Name: Name + nullable: true properties: Name: type: string @@ -119796,6 +120135,7 @@ components: Value: 5 To: 1 HostNetwork: HostNetwork + nullable: true properties: HostNetwork: type: string @@ -119812,6 +120152,7 @@ components: Label: Label Value: 7 To: 2 + nullable: true properties: HostIP: type: string @@ -119828,6 +120169,7 @@ components: BatchSchedulerEnabled: true ServiceSchedulerEnabled: true SysBatchSchedulerEnabled: true + nullable: true properties: BatchSchedulerEnabled: type: boolean @@ -119955,6 +120297,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: Hash: format: byte @@ -120201,9 +120544,10 @@ components: MemoryMaxMB: 5 ModifyIndex: 2147483647 Name: Name + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: @@ -120213,7 +120557,7 @@ components: $ref: '#/components/schemas/QuotaLimit' type: array ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -120236,9 +120580,10 @@ components: Voter: true ID: ID RaftProtocol: RaftProtocol + nullable: true properties: Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Servers: @@ -120254,6 +120599,7 @@ components: Voter: true ID: ID RaftProtocol: RaftProtocol + nullable: true properties: Address: type: string @@ -120288,6 +120634,7 @@ components: Weight: -101 Count: 2147483647 Name: Name + nullable: true properties: Affinities: items: @@ -120298,7 +120645,7 @@ components: $ref: '#/components/schemas/Constraint' type: array Count: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -120309,6 +120656,7 @@ components: PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: PrevAllocID: type: string @@ -120352,6 +120700,7 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: Events: items: @@ -120472,6 +120821,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: CPU: type: integer @@ -120524,6 +120874,7 @@ components: Sum: 7.061401241503109 Count: 0 Name: Name + nullable: true properties: Count: type: integer @@ -120563,12 +120914,13 @@ components: Time: 2147483647 Count: 5 EvalID: EvalID + nullable: true properties: Count: format: int64 type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Error: @@ -120584,7 +120936,7 @@ components: format: int64 type: integer Time: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -120602,9 +120954,10 @@ components: ID: ID ModifyIndex: 2147483647 Namespace: Namespace + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Enabled: @@ -120618,7 +120971,7 @@ components: format: int64 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -120642,9 +120995,10 @@ components: Enabled: true ID: ID ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Enabled: @@ -120652,7 +121006,7 @@ components: ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Target: @@ -120675,6 +121029,7 @@ components: Region: Region Count: 0 Namespace: Namespace + nullable: true properties: Count: format: int64 @@ -120714,15 +121069,16 @@ components: RejectJobRegistration: true SchedulerAlgorithm: SchedulerAlgorithm ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer MemoryOversubscriptionEnabled: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer PauseEvalBroker: @@ -120753,6 +121109,7 @@ components: RejectJobRegistration: true SchedulerAlgorithm: SchedulerAlgorithm ModifyIndex: 2147483647 + nullable: true properties: KnownLeader: type: boolean @@ -120760,7 +121117,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -120776,9 +121133,10 @@ components: Updated: true LastIndex: 2147483647 RequestTime: 6 + nullable: true properties: LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -120805,6 +121163,7 @@ components: Region: Region WaitTime: 1 AllowStale: true + nullable: true properties: AllowStale: type: boolean @@ -120836,7 +121195,7 @@ components: Reverse: type: boolean WaitIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer WaitTime: @@ -120856,6 +121215,7 @@ components: LastIndex: 2147483647 RequestTime: 1 KnownLeader: true + nullable: true properties: KnownLeader: type: boolean @@ -120863,7 +121223,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Matches: @@ -120896,6 +121256,7 @@ components: Healthy: true LastTerm: 2147483647 Name: Name + nullable: true properties: Address: type: string @@ -120907,11 +121268,11 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer LastTerm: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Leader: @@ -120922,6 +121283,7 @@ components: type: string StableSince: format: date-time + nullable: true type: string Version: type: string @@ -121243,6 +121605,7 @@ components: Grace: 0 IgnoreWarnings: true Limit: 4 + nullable: true properties: Address: type: string @@ -121323,6 +121686,7 @@ components: IgnoreWarnings: true Limit: 4 Interval: 7 + nullable: true properties: AddressMode: type: string @@ -121397,13 +121761,14 @@ components: Tags: - Tags - Tags + nullable: true properties: Address: type: string AllocID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenter: @@ -121413,7 +121778,7 @@ components: JobID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -121559,6 +121924,7 @@ components: MaxFiles: 4 MaxFileSizeMB: 1 Name: Name + nullable: true properties: Config: additionalProperties: {} @@ -121599,6 +121965,7 @@ components: - Percent: 177 Value: Value Weight: -95 + nullable: true properties: Attribute: type: string @@ -121615,6 +121982,7 @@ components: example: Percent: 177 Value: Value + nullable: true properties: Percent: maximum: 255 @@ -122499,6 +122867,7 @@ components: LogConfig: MaxFiles: 4 MaxFileSizeMB: 1 + nullable: true properties: Affinities: items: @@ -122581,6 +122950,7 @@ components: GetterOptions: key: GetterOptions GetterSource: GetterSource + nullable: true properties: GetterHeaders: additionalProperties: @@ -122603,6 +122973,7 @@ components: Type: Type ID: ID MountDir: MountDir + nullable: true properties: HealthTimeout: format: int64 @@ -122677,6 +123048,7 @@ components: - null Name: Name Name: Name + nullable: true properties: Annotations: items: @@ -122723,6 +123095,7 @@ components: key: Details DisplayMessage: DisplayMessage KillError: KillError + nullable: true properties: Details: additionalProperties: @@ -125327,6 +125700,7 @@ components: SizeMB: 6 Migrate: true Sticky: true + nullable: true properties: Affinities: items: @@ -125573,6 +125947,7 @@ components: - null Name: Name Name: Name + nullable: true properties: Fields: items: @@ -125592,7 +125967,7 @@ components: type: string Updates: additionalProperties: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -125623,6 +125998,7 @@ components: Desired: 1 Healthy: 9 Placed: 3 + nullable: true properties: Desired: type: integer @@ -125648,6 +126024,7 @@ components: Starting: 4 Running: 2 Queued: 3 + nullable: true properties: Complete: type: integer @@ -125668,6 +126045,7 @@ components: example: Version: 6 DriverState: DriverState + nullable: true properties: DriverState: format: byte @@ -125679,6 +126057,7 @@ components: example: Hook: Hook Sidecar: true + nullable: true properties: Hook: type: string @@ -125749,6 +126128,7 @@ components: TaskHandle: Version: 6 DriverState: DriverState + nullable: true properties: Events: items: @@ -125758,16 +126138,19 @@ components: type: boolean FinishedAt: format: date-time + nullable: true type: string LastRestart: format: date-time + nullable: true type: string Restarts: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer StartedAt: format: date-time + nullable: true type: string State: type: string @@ -125820,6 +126203,7 @@ components: type: object Time: format: date-time + nullable: true type: string UpdateStrategy: example: @@ -125865,6 +126249,7 @@ components: Env: true Namespace: Namespace ChangeMode: ChangeMode + nullable: true properties: ChangeMode: type: string @@ -125909,6 +126294,7 @@ components: FSType: FSType Source: Source Name: Name + nullable: true properties: AccessMode: type: string @@ -125969,7 +126355,7 @@ components: minimum: 0 type: integer uint64: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer securitySchemes: diff --git a/clients/go/v1/api_acl.go b/clients/go/v1/api_acl.go index 675ec544..226cafb5 100644 --- a/clients/go/v1/api_acl.go +++ b/clients/go/v1/api_acl.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ACLApiService ACLApi service type ACLApiService service type ApiDeleteACLPolicyRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService policyName string region *string @@ -38,34 +34,42 @@ type ApiDeleteACLPolicyRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiDeleteACLPolicyRequest) Region(region string) ApiDeleteACLPolicyRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteACLPolicyRequest) Namespace(namespace string) ApiDeleteACLPolicyRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteACLPolicyRequest) XNomadToken(xNomadToken string) ApiDeleteACLPolicyRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteACLPolicyRequest) IdempotencyToken(idempotencyToken string) ApiDeleteACLPolicyRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiDeleteACLPolicyRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteACLPolicyRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteACLPolicyExecute(r) } /* - * DeleteACLPolicy Method for DeleteACLPolicy - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyName The ACL policy name. - * @return ApiDeleteACLPolicyRequest - */ -func (a *ACLApiService) DeleteACLPolicy(ctx _context.Context, policyName string) ApiDeleteACLPolicyRequest { +DeleteACLPolicy Method for DeleteACLPolicy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyName The ACL policy name. + @return ApiDeleteACLPolicyRequest +*/ +func (a *ACLApiService) DeleteACLPolicy(ctx context.Context, policyName string) ApiDeleteACLPolicyRequest { return ApiDeleteACLPolicyRequest{ ApiService: a, ctx: ctx, @@ -73,29 +77,25 @@ func (a *ACLApiService) DeleteACLPolicy(ctx _context.Context, policyName string) } } -/* - * Execute executes the request - */ -func (a *ACLApiService) DeleteACLPolicyExecute(r ApiDeleteACLPolicyRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *ACLApiService) DeleteACLPolicyExecute(r ApiDeleteACLPolicyRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.DeleteACLPolicy") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/policy/{policyName}" - localVarPath = strings.Replace(localVarPath, "{"+"policyName"+"}", _neturl.PathEscape(parameterToString(r.policyName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"policyName"+"}", url.PathEscape(parameterToString(r.policyName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -140,7 +140,7 @@ func (a *ACLApiService) DeleteACLPolicyExecute(r ApiDeleteACLPolicyRequest) (*_n } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -150,15 +150,15 @@ func (a *ACLApiService) DeleteACLPolicyExecute(r ApiDeleteACLPolicyRequest) (*_n return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -169,7 +169,7 @@ func (a *ACLApiService) DeleteACLPolicyExecute(r ApiDeleteACLPolicyRequest) (*_n } type ApiDeleteACLTokenRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService tokenAccessor string region *string @@ -178,34 +178,42 @@ type ApiDeleteACLTokenRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiDeleteACLTokenRequest) Region(region string) ApiDeleteACLTokenRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteACLTokenRequest) Namespace(namespace string) ApiDeleteACLTokenRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteACLTokenRequest) XNomadToken(xNomadToken string) ApiDeleteACLTokenRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteACLTokenRequest) IdempotencyToken(idempotencyToken string) ApiDeleteACLTokenRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiDeleteACLTokenRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteACLTokenRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteACLTokenExecute(r) } /* - * DeleteACLToken Method for DeleteACLToken - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tokenAccessor The token accessor ID. - * @return ApiDeleteACLTokenRequest - */ -func (a *ACLApiService) DeleteACLToken(ctx _context.Context, tokenAccessor string) ApiDeleteACLTokenRequest { +DeleteACLToken Method for DeleteACLToken + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenAccessor The token accessor ID. + @return ApiDeleteACLTokenRequest +*/ +func (a *ACLApiService) DeleteACLToken(ctx context.Context, tokenAccessor string) ApiDeleteACLTokenRequest { return ApiDeleteACLTokenRequest{ ApiService: a, ctx: ctx, @@ -213,29 +221,25 @@ func (a *ACLApiService) DeleteACLToken(ctx _context.Context, tokenAccessor strin } } -/* - * Execute executes the request - */ -func (a *ACLApiService) DeleteACLTokenExecute(r ApiDeleteACLTokenRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *ACLApiService) DeleteACLTokenExecute(r ApiDeleteACLTokenRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.DeleteACLToken") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/token/{tokenAccessor}" - localVarPath = strings.Replace(localVarPath, "{"+"tokenAccessor"+"}", _neturl.PathEscape(parameterToString(r.tokenAccessor, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tokenAccessor"+"}", url.PathEscape(parameterToString(r.tokenAccessor, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -280,7 +284,7 @@ func (a *ACLApiService) DeleteACLTokenExecute(r ApiDeleteACLTokenRequest) (*_net } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -290,15 +294,15 @@ func (a *ACLApiService) DeleteACLTokenExecute(r ApiDeleteACLTokenRequest) (*_net return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -309,7 +313,7 @@ func (a *ACLApiService) DeleteACLTokenExecute(r ApiDeleteACLTokenRequest) (*_net } type ApiGetACLPoliciesRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService region *string namespace *string @@ -322,83 +326,97 @@ type ApiGetACLPoliciesRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetACLPoliciesRequest) Region(region string) ApiGetACLPoliciesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetACLPoliciesRequest) Namespace(namespace string) ApiGetACLPoliciesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetACLPoliciesRequest) Index(index int32) ApiGetACLPoliciesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetACLPoliciesRequest) Wait(wait string) ApiGetACLPoliciesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetACLPoliciesRequest) Stale(stale string) ApiGetACLPoliciesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetACLPoliciesRequest) Prefix(prefix string) ApiGetACLPoliciesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetACLPoliciesRequest) XNomadToken(xNomadToken string) ApiGetACLPoliciesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetACLPoliciesRequest) PerPage(perPage int32) ApiGetACLPoliciesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetACLPoliciesRequest) NextToken(nextToken string) ApiGetACLPoliciesRequest { r.nextToken = &nextToken return r } -func (r ApiGetACLPoliciesRequest) Execute() ([]ACLPolicyListStub, *_nethttp.Response, error) { +func (r ApiGetACLPoliciesRequest) Execute() ([]ACLPolicyListStub, *http.Response, error) { return r.ApiService.GetACLPoliciesExecute(r) } /* - * GetACLPolicies Method for GetACLPolicies - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetACLPoliciesRequest - */ -func (a *ACLApiService) GetACLPolicies(ctx _context.Context) ApiGetACLPoliciesRequest { +GetACLPolicies Method for GetACLPolicies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetACLPoliciesRequest +*/ +func (a *ACLApiService) GetACLPolicies(ctx context.Context) ApiGetACLPoliciesRequest { return ApiGetACLPoliciesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []ACLPolicyListStub - */ -func (a *ACLApiService) GetACLPoliciesExecute(r ApiGetACLPoliciesRequest) ([]ACLPolicyListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []ACLPolicyListStub +func (a *ACLApiService) GetACLPoliciesExecute(r ApiGetACLPoliciesRequest) ([]ACLPolicyListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ACLPolicyListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.GetACLPolicies") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/policies" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -458,7 +476,7 @@ func (a *ACLApiService) GetACLPoliciesExecute(r ApiGetACLPoliciesRequest) ([]ACL } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -468,15 +486,15 @@ func (a *ACLApiService) GetACLPoliciesExecute(r ApiGetACLPoliciesRequest) ([]ACL return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -485,7 +503,7 @@ func (a *ACLApiService) GetACLPoliciesExecute(r ApiGetACLPoliciesRequest) ([]ACL err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -496,7 +514,7 @@ func (a *ACLApiService) GetACLPoliciesExecute(r ApiGetACLPoliciesRequest) ([]ACL } type ApiGetACLPolicyRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService policyName string region *string @@ -510,54 +528,72 @@ type ApiGetACLPolicyRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetACLPolicyRequest) Region(region string) ApiGetACLPolicyRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetACLPolicyRequest) Namespace(namespace string) ApiGetACLPolicyRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetACLPolicyRequest) Index(index int32) ApiGetACLPolicyRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetACLPolicyRequest) Wait(wait string) ApiGetACLPolicyRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetACLPolicyRequest) Stale(stale string) ApiGetACLPolicyRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetACLPolicyRequest) Prefix(prefix string) ApiGetACLPolicyRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetACLPolicyRequest) XNomadToken(xNomadToken string) ApiGetACLPolicyRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetACLPolicyRequest) PerPage(perPage int32) ApiGetACLPolicyRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetACLPolicyRequest) NextToken(nextToken string) ApiGetACLPolicyRequest { r.nextToken = &nextToken return r } -func (r ApiGetACLPolicyRequest) Execute() (ACLPolicy, *_nethttp.Response, error) { +func (r ApiGetACLPolicyRequest) Execute() (*ACLPolicy, *http.Response, error) { return r.ApiService.GetACLPolicyExecute(r) } /* - * GetACLPolicy Method for GetACLPolicy - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyName The ACL policy name. - * @return ApiGetACLPolicyRequest - */ -func (a *ACLApiService) GetACLPolicy(ctx _context.Context, policyName string) ApiGetACLPolicyRequest { +GetACLPolicy Method for GetACLPolicy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyName The ACL policy name. + @return ApiGetACLPolicyRequest +*/ +func (a *ACLApiService) GetACLPolicy(ctx context.Context, policyName string) ApiGetACLPolicyRequest { return ApiGetACLPolicyRequest{ ApiService: a, ctx: ctx, @@ -565,31 +601,27 @@ func (a *ACLApiService) GetACLPolicy(ctx _context.Context, policyName string) Ap } } -/* - * Execute executes the request - * @return ACLPolicy - */ -func (a *ACLApiService) GetACLPolicyExecute(r ApiGetACLPolicyRequest) (ACLPolicy, *_nethttp.Response, error) { +// Execute executes the request +// @return ACLPolicy +func (a *ACLApiService) GetACLPolicyExecute(r ApiGetACLPolicyRequest) (*ACLPolicy, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ACLPolicy + formFiles []formFile + localVarReturnValue *ACLPolicy ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.GetACLPolicy") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/policy/{policyName}" - localVarPath = strings.Replace(localVarPath, "{"+"policyName"+"}", _neturl.PathEscape(parameterToString(r.policyName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"policyName"+"}", url.PathEscape(parameterToString(r.policyName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -649,7 +681,7 @@ func (a *ACLApiService) GetACLPolicyExecute(r ApiGetACLPolicyRequest) (ACLPolicy } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -659,15 +691,15 @@ func (a *ACLApiService) GetACLPolicyExecute(r ApiGetACLPolicyRequest) (ACLPolicy return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -676,7 +708,7 @@ func (a *ACLApiService) GetACLPolicyExecute(r ApiGetACLPolicyRequest) (ACLPolicy err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -687,7 +719,7 @@ func (a *ACLApiService) GetACLPolicyExecute(r ApiGetACLPolicyRequest) (ACLPolicy } type ApiGetACLTokenRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService tokenAccessor string region *string @@ -701,54 +733,72 @@ type ApiGetACLTokenRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetACLTokenRequest) Region(region string) ApiGetACLTokenRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetACLTokenRequest) Namespace(namespace string) ApiGetACLTokenRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetACLTokenRequest) Index(index int32) ApiGetACLTokenRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetACLTokenRequest) Wait(wait string) ApiGetACLTokenRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetACLTokenRequest) Stale(stale string) ApiGetACLTokenRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetACLTokenRequest) Prefix(prefix string) ApiGetACLTokenRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetACLTokenRequest) XNomadToken(xNomadToken string) ApiGetACLTokenRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetACLTokenRequest) PerPage(perPage int32) ApiGetACLTokenRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetACLTokenRequest) NextToken(nextToken string) ApiGetACLTokenRequest { r.nextToken = &nextToken return r } -func (r ApiGetACLTokenRequest) Execute() (ACLToken, *_nethttp.Response, error) { +func (r ApiGetACLTokenRequest) Execute() (*ACLToken, *http.Response, error) { return r.ApiService.GetACLTokenExecute(r) } /* - * GetACLToken Method for GetACLToken - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tokenAccessor The token accessor ID. - * @return ApiGetACLTokenRequest - */ -func (a *ACLApiService) GetACLToken(ctx _context.Context, tokenAccessor string) ApiGetACLTokenRequest { +GetACLToken Method for GetACLToken + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenAccessor The token accessor ID. + @return ApiGetACLTokenRequest +*/ +func (a *ACLApiService) GetACLToken(ctx context.Context, tokenAccessor string) ApiGetACLTokenRequest { return ApiGetACLTokenRequest{ ApiService: a, ctx: ctx, @@ -756,31 +806,27 @@ func (a *ACLApiService) GetACLToken(ctx _context.Context, tokenAccessor string) } } -/* - * Execute executes the request - * @return ACLToken - */ -func (a *ACLApiService) GetACLTokenExecute(r ApiGetACLTokenRequest) (ACLToken, *_nethttp.Response, error) { +// Execute executes the request +// @return ACLToken +func (a *ACLApiService) GetACLTokenExecute(r ApiGetACLTokenRequest) (*ACLToken, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ACLToken + formFiles []formFile + localVarReturnValue *ACLToken ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.GetACLToken") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/token/{tokenAccessor}" - localVarPath = strings.Replace(localVarPath, "{"+"tokenAccessor"+"}", _neturl.PathEscape(parameterToString(r.tokenAccessor, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tokenAccessor"+"}", url.PathEscape(parameterToString(r.tokenAccessor, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -840,7 +886,7 @@ func (a *ACLApiService) GetACLTokenExecute(r ApiGetACLTokenRequest) (ACLToken, * } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -850,15 +896,15 @@ func (a *ACLApiService) GetACLTokenExecute(r ApiGetACLTokenRequest) (ACLToken, * return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -867,7 +913,7 @@ func (a *ACLApiService) GetACLTokenExecute(r ApiGetACLTokenRequest) (ACLToken, * err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -878,7 +924,7 @@ func (a *ACLApiService) GetACLTokenExecute(r ApiGetACLTokenRequest) (ACLToken, * } type ApiGetACLTokenSelfRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService region *string namespace *string @@ -891,83 +937,97 @@ type ApiGetACLTokenSelfRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetACLTokenSelfRequest) Region(region string) ApiGetACLTokenSelfRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetACLTokenSelfRequest) Namespace(namespace string) ApiGetACLTokenSelfRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetACLTokenSelfRequest) Index(index int32) ApiGetACLTokenSelfRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetACLTokenSelfRequest) Wait(wait string) ApiGetACLTokenSelfRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetACLTokenSelfRequest) Stale(stale string) ApiGetACLTokenSelfRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetACLTokenSelfRequest) Prefix(prefix string) ApiGetACLTokenSelfRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetACLTokenSelfRequest) XNomadToken(xNomadToken string) ApiGetACLTokenSelfRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetACLTokenSelfRequest) PerPage(perPage int32) ApiGetACLTokenSelfRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetACLTokenSelfRequest) NextToken(nextToken string) ApiGetACLTokenSelfRequest { r.nextToken = &nextToken return r } -func (r ApiGetACLTokenSelfRequest) Execute() (ACLToken, *_nethttp.Response, error) { +func (r ApiGetACLTokenSelfRequest) Execute() (*ACLToken, *http.Response, error) { return r.ApiService.GetACLTokenSelfExecute(r) } /* - * GetACLTokenSelf Method for GetACLTokenSelf - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetACLTokenSelfRequest - */ -func (a *ACLApiService) GetACLTokenSelf(ctx _context.Context) ApiGetACLTokenSelfRequest { +GetACLTokenSelf Method for GetACLTokenSelf + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetACLTokenSelfRequest +*/ +func (a *ACLApiService) GetACLTokenSelf(ctx context.Context) ApiGetACLTokenSelfRequest { return ApiGetACLTokenSelfRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ACLToken - */ -func (a *ACLApiService) GetACLTokenSelfExecute(r ApiGetACLTokenSelfRequest) (ACLToken, *_nethttp.Response, error) { +// Execute executes the request +// @return ACLToken +func (a *ACLApiService) GetACLTokenSelfExecute(r ApiGetACLTokenSelfRequest) (*ACLToken, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ACLToken + formFiles []formFile + localVarReturnValue *ACLToken ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.GetACLTokenSelf") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/token" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1027,7 +1087,7 @@ func (a *ACLApiService) GetACLTokenSelfExecute(r ApiGetACLTokenSelfRequest) (ACL } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1037,15 +1097,15 @@ func (a *ACLApiService) GetACLTokenSelfExecute(r ApiGetACLTokenSelfRequest) (ACL return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1054,7 +1114,7 @@ func (a *ACLApiService) GetACLTokenSelfExecute(r ApiGetACLTokenSelfRequest) (ACL err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1065,7 +1125,7 @@ func (a *ACLApiService) GetACLTokenSelfExecute(r ApiGetACLTokenSelfRequest) (ACL } type ApiGetACLTokensRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService region *string namespace *string @@ -1078,83 +1138,97 @@ type ApiGetACLTokensRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetACLTokensRequest) Region(region string) ApiGetACLTokensRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetACLTokensRequest) Namespace(namespace string) ApiGetACLTokensRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetACLTokensRequest) Index(index int32) ApiGetACLTokensRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetACLTokensRequest) Wait(wait string) ApiGetACLTokensRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetACLTokensRequest) Stale(stale string) ApiGetACLTokensRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetACLTokensRequest) Prefix(prefix string) ApiGetACLTokensRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetACLTokensRequest) XNomadToken(xNomadToken string) ApiGetACLTokensRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetACLTokensRequest) PerPage(perPage int32) ApiGetACLTokensRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetACLTokensRequest) NextToken(nextToken string) ApiGetACLTokensRequest { r.nextToken = &nextToken return r } -func (r ApiGetACLTokensRequest) Execute() ([]ACLTokenListStub, *_nethttp.Response, error) { +func (r ApiGetACLTokensRequest) Execute() ([]ACLTokenListStub, *http.Response, error) { return r.ApiService.GetACLTokensExecute(r) } /* - * GetACLTokens Method for GetACLTokens - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetACLTokensRequest - */ -func (a *ACLApiService) GetACLTokens(ctx _context.Context) ApiGetACLTokensRequest { +GetACLTokens Method for GetACLTokens + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetACLTokensRequest +*/ +func (a *ACLApiService) GetACLTokens(ctx context.Context) ApiGetACLTokensRequest { return ApiGetACLTokensRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []ACLTokenListStub - */ -func (a *ACLApiService) GetACLTokensExecute(r ApiGetACLTokensRequest) ([]ACLTokenListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []ACLTokenListStub +func (a *ACLApiService) GetACLTokensExecute(r ApiGetACLTokensRequest) ([]ACLTokenListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ACLTokenListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.GetACLTokens") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/tokens" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1214,7 +1288,7 @@ func (a *ACLApiService) GetACLTokensExecute(r ApiGetACLTokensRequest) ([]ACLToke } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1224,15 +1298,15 @@ func (a *ACLApiService) GetACLTokensExecute(r ApiGetACLTokensRequest) ([]ACLToke return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1241,7 +1315,7 @@ func (a *ACLApiService) GetACLTokensExecute(r ApiGetACLTokensRequest) ([]ACLToke err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1252,7 +1326,7 @@ func (a *ACLApiService) GetACLTokensExecute(r ApiGetACLTokensRequest) ([]ACLToke } type ApiPostACLBootstrapRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService region *string namespace *string @@ -1260,63 +1334,67 @@ type ApiPostACLBootstrapRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiPostACLBootstrapRequest) Region(region string) ApiPostACLBootstrapRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostACLBootstrapRequest) Namespace(namespace string) ApiPostACLBootstrapRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostACLBootstrapRequest) XNomadToken(xNomadToken string) ApiPostACLBootstrapRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostACLBootstrapRequest) IdempotencyToken(idempotencyToken string) ApiPostACLBootstrapRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostACLBootstrapRequest) Execute() (ACLToken, *_nethttp.Response, error) { +func (r ApiPostACLBootstrapRequest) Execute() (*ACLToken, *http.Response, error) { return r.ApiService.PostACLBootstrapExecute(r) } /* - * PostACLBootstrap Method for PostACLBootstrap - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostACLBootstrapRequest - */ -func (a *ACLApiService) PostACLBootstrap(ctx _context.Context) ApiPostACLBootstrapRequest { +PostACLBootstrap Method for PostACLBootstrap + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostACLBootstrapRequest +*/ +func (a *ACLApiService) PostACLBootstrap(ctx context.Context) ApiPostACLBootstrapRequest { return ApiPostACLBootstrapRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ACLToken - */ -func (a *ACLApiService) PostACLBootstrapExecute(r ApiPostACLBootstrapRequest) (ACLToken, *_nethttp.Response, error) { +// Execute executes the request +// @return ACLToken +func (a *ACLApiService) PostACLBootstrapExecute(r ApiPostACLBootstrapRequest) (*ACLToken, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ACLToken + formFiles []formFile + localVarReturnValue *ACLToken ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.PostACLBootstrap") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/bootstrap" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1361,7 +1439,7 @@ func (a *ACLApiService) PostACLBootstrapExecute(r ApiPostACLBootstrapRequest) (A } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1371,15 +1449,15 @@ func (a *ACLApiService) PostACLBootstrapExecute(r ApiPostACLBootstrapRequest) (A return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1388,7 +1466,7 @@ func (a *ACLApiService) PostACLBootstrapExecute(r ApiPostACLBootstrapRequest) (A err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1399,7 +1477,7 @@ func (a *ACLApiService) PostACLBootstrapExecute(r ApiPostACLBootstrapRequest) (A } type ApiPostACLPolicyRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService policyName string aCLPolicy *ACLPolicy @@ -1413,34 +1491,43 @@ func (r ApiPostACLPolicyRequest) ACLPolicy(aCLPolicy ACLPolicy) ApiPostACLPolicy r.aCLPolicy = &aCLPolicy return r } + +// Filters results based on the specified region. func (r ApiPostACLPolicyRequest) Region(region string) ApiPostACLPolicyRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostACLPolicyRequest) Namespace(namespace string) ApiPostACLPolicyRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostACLPolicyRequest) XNomadToken(xNomadToken string) ApiPostACLPolicyRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostACLPolicyRequest) IdempotencyToken(idempotencyToken string) ApiPostACLPolicyRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostACLPolicyRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPostACLPolicyRequest) Execute() (*http.Response, error) { return r.ApiService.PostACLPolicyExecute(r) } /* - * PostACLPolicy Method for PostACLPolicy - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyName The ACL policy name. - * @return ApiPostACLPolicyRequest - */ -func (a *ACLApiService) PostACLPolicy(ctx _context.Context, policyName string) ApiPostACLPolicyRequest { +PostACLPolicy Method for PostACLPolicy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyName The ACL policy name. + @return ApiPostACLPolicyRequest +*/ +func (a *ACLApiService) PostACLPolicy(ctx context.Context, policyName string) ApiPostACLPolicyRequest { return ApiPostACLPolicyRequest{ ApiService: a, ctx: ctx, @@ -1448,29 +1535,25 @@ func (a *ACLApiService) PostACLPolicy(ctx _context.Context, policyName string) A } } -/* - * Execute executes the request - */ -func (a *ACLApiService) PostACLPolicyExecute(r ApiPostACLPolicyRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *ACLApiService) PostACLPolicyExecute(r ApiPostACLPolicyRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.PostACLPolicy") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/policy/{policyName}" - localVarPath = strings.Replace(localVarPath, "{"+"policyName"+"}", _neturl.PathEscape(parameterToString(r.policyName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"policyName"+"}", url.PathEscape(parameterToString(r.policyName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.aCLPolicy == nil { return nil, reportError("aCLPolicy is required and must be specified") } @@ -1520,7 +1603,7 @@ func (a *ACLApiService) PostACLPolicyExecute(r ApiPostACLPolicyRequest) (*_netht } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1530,15 +1613,15 @@ func (a *ACLApiService) PostACLPolicyExecute(r ApiPostACLPolicyRequest) (*_netht return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1549,7 +1632,7 @@ func (a *ACLApiService) PostACLPolicyExecute(r ApiPostACLPolicyRequest) (*_netht } type ApiPostACLTokenRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService tokenAccessor string aCLToken *ACLToken @@ -1563,34 +1646,43 @@ func (r ApiPostACLTokenRequest) ACLToken(aCLToken ACLToken) ApiPostACLTokenReque r.aCLToken = &aCLToken return r } + +// Filters results based on the specified region. func (r ApiPostACLTokenRequest) Region(region string) ApiPostACLTokenRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostACLTokenRequest) Namespace(namespace string) ApiPostACLTokenRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostACLTokenRequest) XNomadToken(xNomadToken string) ApiPostACLTokenRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostACLTokenRequest) IdempotencyToken(idempotencyToken string) ApiPostACLTokenRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostACLTokenRequest) Execute() (ACLToken, *_nethttp.Response, error) { +func (r ApiPostACLTokenRequest) Execute() (*ACLToken, *http.Response, error) { return r.ApiService.PostACLTokenExecute(r) } /* - * PostACLToken Method for PostACLToken - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tokenAccessor The token accessor ID. - * @return ApiPostACLTokenRequest - */ -func (a *ACLApiService) PostACLToken(ctx _context.Context, tokenAccessor string) ApiPostACLTokenRequest { +PostACLToken Method for PostACLToken + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenAccessor The token accessor ID. + @return ApiPostACLTokenRequest +*/ +func (a *ACLApiService) PostACLToken(ctx context.Context, tokenAccessor string) ApiPostACLTokenRequest { return ApiPostACLTokenRequest{ ApiService: a, ctx: ctx, @@ -1598,31 +1690,27 @@ func (a *ACLApiService) PostACLToken(ctx _context.Context, tokenAccessor string) } } -/* - * Execute executes the request - * @return ACLToken - */ -func (a *ACLApiService) PostACLTokenExecute(r ApiPostACLTokenRequest) (ACLToken, *_nethttp.Response, error) { +// Execute executes the request +// @return ACLToken +func (a *ACLApiService) PostACLTokenExecute(r ApiPostACLTokenRequest) (*ACLToken, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ACLToken + formFiles []formFile + localVarReturnValue *ACLToken ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.PostACLToken") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/token/{tokenAccessor}" - localVarPath = strings.Replace(localVarPath, "{"+"tokenAccessor"+"}", _neturl.PathEscape(parameterToString(r.tokenAccessor, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tokenAccessor"+"}", url.PathEscape(parameterToString(r.tokenAccessor, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.aCLToken == nil { return localVarReturnValue, nil, reportError("aCLToken is required and must be specified") } @@ -1672,7 +1760,7 @@ func (a *ACLApiService) PostACLTokenExecute(r ApiPostACLTokenRequest) (ACLToken, } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1682,15 +1770,15 @@ func (a *ACLApiService) PostACLTokenExecute(r ApiPostACLTokenRequest) (ACLToken, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1699,7 +1787,7 @@ func (a *ACLApiService) PostACLTokenExecute(r ApiPostACLTokenRequest) (ACLToken, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1710,7 +1798,7 @@ func (a *ACLApiService) PostACLTokenExecute(r ApiPostACLTokenRequest) (ACLToken, } type ApiPostACLTokenOnetimeRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService region *string namespace *string @@ -1718,63 +1806,67 @@ type ApiPostACLTokenOnetimeRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiPostACLTokenOnetimeRequest) Region(region string) ApiPostACLTokenOnetimeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostACLTokenOnetimeRequest) Namespace(namespace string) ApiPostACLTokenOnetimeRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostACLTokenOnetimeRequest) XNomadToken(xNomadToken string) ApiPostACLTokenOnetimeRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostACLTokenOnetimeRequest) IdempotencyToken(idempotencyToken string) ApiPostACLTokenOnetimeRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostACLTokenOnetimeRequest) Execute() (OneTimeToken, *_nethttp.Response, error) { +func (r ApiPostACLTokenOnetimeRequest) Execute() (*OneTimeToken, *http.Response, error) { return r.ApiService.PostACLTokenOnetimeExecute(r) } /* - * PostACLTokenOnetime Method for PostACLTokenOnetime - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostACLTokenOnetimeRequest - */ -func (a *ACLApiService) PostACLTokenOnetime(ctx _context.Context) ApiPostACLTokenOnetimeRequest { +PostACLTokenOnetime Method for PostACLTokenOnetime + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostACLTokenOnetimeRequest +*/ +func (a *ACLApiService) PostACLTokenOnetime(ctx context.Context) ApiPostACLTokenOnetimeRequest { return ApiPostACLTokenOnetimeRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return OneTimeToken - */ -func (a *ACLApiService) PostACLTokenOnetimeExecute(r ApiPostACLTokenOnetimeRequest) (OneTimeToken, *_nethttp.Response, error) { +// Execute executes the request +// @return OneTimeToken +func (a *ACLApiService) PostACLTokenOnetimeExecute(r ApiPostACLTokenOnetimeRequest) (*OneTimeToken, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OneTimeToken + formFiles []formFile + localVarReturnValue *OneTimeToken ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.PostACLTokenOnetime") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/token/onetime" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1819,7 +1911,7 @@ func (a *ACLApiService) PostACLTokenOnetimeExecute(r ApiPostACLTokenOnetimeReque } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1829,15 +1921,15 @@ func (a *ACLApiService) PostACLTokenOnetimeExecute(r ApiPostACLTokenOnetimeReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1846,7 +1938,7 @@ func (a *ACLApiService) PostACLTokenOnetimeExecute(r ApiPostACLTokenOnetimeReque err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1857,7 +1949,7 @@ func (a *ACLApiService) PostACLTokenOnetimeExecute(r ApiPostACLTokenOnetimeReque } type ApiPostACLTokenOnetimeExchangeRequest struct { - ctx _context.Context + ctx context.Context ApiService *ACLApiService oneTimeTokenExchangeRequest *OneTimeTokenExchangeRequest region *string @@ -1870,63 +1962,68 @@ func (r ApiPostACLTokenOnetimeExchangeRequest) OneTimeTokenExchangeRequest(oneTi r.oneTimeTokenExchangeRequest = &oneTimeTokenExchangeRequest return r } + +// Filters results based on the specified region. func (r ApiPostACLTokenOnetimeExchangeRequest) Region(region string) ApiPostACLTokenOnetimeExchangeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostACLTokenOnetimeExchangeRequest) Namespace(namespace string) ApiPostACLTokenOnetimeExchangeRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostACLTokenOnetimeExchangeRequest) XNomadToken(xNomadToken string) ApiPostACLTokenOnetimeExchangeRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostACLTokenOnetimeExchangeRequest) IdempotencyToken(idempotencyToken string) ApiPostACLTokenOnetimeExchangeRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostACLTokenOnetimeExchangeRequest) Execute() (ACLToken, *_nethttp.Response, error) { +func (r ApiPostACLTokenOnetimeExchangeRequest) Execute() (*ACLToken, *http.Response, error) { return r.ApiService.PostACLTokenOnetimeExchangeExecute(r) } /* - * PostACLTokenOnetimeExchange Method for PostACLTokenOnetimeExchange - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostACLTokenOnetimeExchangeRequest - */ -func (a *ACLApiService) PostACLTokenOnetimeExchange(ctx _context.Context) ApiPostACLTokenOnetimeExchangeRequest { +PostACLTokenOnetimeExchange Method for PostACLTokenOnetimeExchange + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostACLTokenOnetimeExchangeRequest +*/ +func (a *ACLApiService) PostACLTokenOnetimeExchange(ctx context.Context) ApiPostACLTokenOnetimeExchangeRequest { return ApiPostACLTokenOnetimeExchangeRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ACLToken - */ -func (a *ACLApiService) PostACLTokenOnetimeExchangeExecute(r ApiPostACLTokenOnetimeExchangeRequest) (ACLToken, *_nethttp.Response, error) { +// Execute executes the request +// @return ACLToken +func (a *ACLApiService) PostACLTokenOnetimeExchangeExecute(r ApiPostACLTokenOnetimeExchangeRequest) (*ACLToken, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ACLToken + formFiles []formFile + localVarReturnValue *ACLToken ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLApiService.PostACLTokenOnetimeExchange") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/acl/token/onetime/exchange" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.oneTimeTokenExchangeRequest == nil { return localVarReturnValue, nil, reportError("oneTimeTokenExchangeRequest is required and must be specified") } @@ -1976,7 +2073,7 @@ func (a *ACLApiService) PostACLTokenOnetimeExchangeExecute(r ApiPostACLTokenOnet } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1986,15 +2083,15 @@ func (a *ACLApiService) PostACLTokenOnetimeExchangeExecute(r ApiPostACLTokenOnet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2003,7 +2100,7 @@ func (a *ACLApiService) PostACLTokenOnetimeExchangeExecute(r ApiPostACLTokenOnet err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_allocations.go b/clients/go/v1/api_allocations.go index 47bcd502..a455947c 100644 --- a/clients/go/v1/api_allocations.go +++ b/clients/go/v1/api_allocations.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // AllocationsApiService AllocationsApi service type AllocationsApiService service type ApiGetAllocationRequest struct { - ctx _context.Context + ctx context.Context ApiService *AllocationsApiService allocID string region *string @@ -43,54 +39,72 @@ type ApiGetAllocationRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetAllocationRequest) Region(region string) ApiGetAllocationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetAllocationRequest) Namespace(namespace string) ApiGetAllocationRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetAllocationRequest) Index(index int32) ApiGetAllocationRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetAllocationRequest) Wait(wait string) ApiGetAllocationRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetAllocationRequest) Stale(stale string) ApiGetAllocationRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetAllocationRequest) Prefix(prefix string) ApiGetAllocationRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetAllocationRequest) XNomadToken(xNomadToken string) ApiGetAllocationRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetAllocationRequest) PerPage(perPage int32) ApiGetAllocationRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetAllocationRequest) NextToken(nextToken string) ApiGetAllocationRequest { r.nextToken = &nextToken return r } -func (r ApiGetAllocationRequest) Execute() (Allocation, *_nethttp.Response, error) { +func (r ApiGetAllocationRequest) Execute() (*Allocation, *http.Response, error) { return r.ApiService.GetAllocationExecute(r) } /* - * GetAllocation Method for GetAllocation - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param allocID Allocation ID. - * @return ApiGetAllocationRequest - */ -func (a *AllocationsApiService) GetAllocation(ctx _context.Context, allocID string) ApiGetAllocationRequest { +GetAllocation Method for GetAllocation + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param allocID Allocation ID. + @return ApiGetAllocationRequest +*/ +func (a *AllocationsApiService) GetAllocation(ctx context.Context, allocID string) ApiGetAllocationRequest { return ApiGetAllocationRequest{ ApiService: a, ctx: ctx, @@ -98,31 +112,27 @@ func (a *AllocationsApiService) GetAllocation(ctx _context.Context, allocID stri } } -/* - * Execute executes the request - * @return Allocation - */ -func (a *AllocationsApiService) GetAllocationExecute(r ApiGetAllocationRequest) (Allocation, *_nethttp.Response, error) { +// Execute executes the request +// @return Allocation +func (a *AllocationsApiService) GetAllocationExecute(r ApiGetAllocationRequest) (*Allocation, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Allocation + formFiles []formFile + localVarReturnValue *Allocation ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AllocationsApiService.GetAllocation") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/allocation/{allocID}" - localVarPath = strings.Replace(localVarPath, "{"+"allocID"+"}", _neturl.PathEscape(parameterToString(r.allocID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"allocID"+"}", url.PathEscape(parameterToString(r.allocID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -182,7 +192,7 @@ func (a *AllocationsApiService) GetAllocationExecute(r ApiGetAllocationRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -192,15 +202,15 @@ func (a *AllocationsApiService) GetAllocationExecute(r ApiGetAllocationRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -209,7 +219,7 @@ func (a *AllocationsApiService) GetAllocationExecute(r ApiGetAllocationRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -220,7 +230,7 @@ func (a *AllocationsApiService) GetAllocationExecute(r ApiGetAllocationRequest) } type ApiGetAllocationServicesRequest struct { - ctx _context.Context + ctx context.Context ApiService *AllocationsApiService allocID string region *string @@ -234,54 +244,72 @@ type ApiGetAllocationServicesRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetAllocationServicesRequest) Region(region string) ApiGetAllocationServicesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetAllocationServicesRequest) Namespace(namespace string) ApiGetAllocationServicesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetAllocationServicesRequest) Index(index int32) ApiGetAllocationServicesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetAllocationServicesRequest) Wait(wait string) ApiGetAllocationServicesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetAllocationServicesRequest) Stale(stale string) ApiGetAllocationServicesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetAllocationServicesRequest) Prefix(prefix string) ApiGetAllocationServicesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetAllocationServicesRequest) XNomadToken(xNomadToken string) ApiGetAllocationServicesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetAllocationServicesRequest) PerPage(perPage int32) ApiGetAllocationServicesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetAllocationServicesRequest) NextToken(nextToken string) ApiGetAllocationServicesRequest { r.nextToken = &nextToken return r } -func (r ApiGetAllocationServicesRequest) Execute() ([]ServiceRegistration, *_nethttp.Response, error) { +func (r ApiGetAllocationServicesRequest) Execute() ([]ServiceRegistration, *http.Response, error) { return r.ApiService.GetAllocationServicesExecute(r) } /* - * GetAllocationServices Method for GetAllocationServices - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param allocID Allocation ID. - * @return ApiGetAllocationServicesRequest - */ -func (a *AllocationsApiService) GetAllocationServices(ctx _context.Context, allocID string) ApiGetAllocationServicesRequest { +GetAllocationServices Method for GetAllocationServices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param allocID Allocation ID. + @return ApiGetAllocationServicesRequest +*/ +func (a *AllocationsApiService) GetAllocationServices(ctx context.Context, allocID string) ApiGetAllocationServicesRequest { return ApiGetAllocationServicesRequest{ ApiService: a, ctx: ctx, @@ -289,31 +317,27 @@ func (a *AllocationsApiService) GetAllocationServices(ctx _context.Context, allo } } -/* - * Execute executes the request - * @return []ServiceRegistration - */ -func (a *AllocationsApiService) GetAllocationServicesExecute(r ApiGetAllocationServicesRequest) ([]ServiceRegistration, *_nethttp.Response, error) { +// Execute executes the request +// @return []ServiceRegistration +func (a *AllocationsApiService) GetAllocationServicesExecute(r ApiGetAllocationServicesRequest) ([]ServiceRegistration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ServiceRegistration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AllocationsApiService.GetAllocationServices") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/allocation/{allocID}/services" - localVarPath = strings.Replace(localVarPath, "{"+"allocID"+"}", _neturl.PathEscape(parameterToString(r.allocID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"allocID"+"}", url.PathEscape(parameterToString(r.allocID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -373,7 +397,7 @@ func (a *AllocationsApiService) GetAllocationServicesExecute(r ApiGetAllocationS } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -383,15 +407,15 @@ func (a *AllocationsApiService) GetAllocationServicesExecute(r ApiGetAllocationS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -400,7 +424,7 @@ func (a *AllocationsApiService) GetAllocationServicesExecute(r ApiGetAllocationS err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -411,7 +435,7 @@ func (a *AllocationsApiService) GetAllocationServicesExecute(r ApiGetAllocationS } type ApiGetAllocationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AllocationsApiService region *string namespace *string @@ -426,91 +450,109 @@ type ApiGetAllocationsRequest struct { taskStates *bool } +// Filters results based on the specified region. func (r ApiGetAllocationsRequest) Region(region string) ApiGetAllocationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetAllocationsRequest) Namespace(namespace string) ApiGetAllocationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetAllocationsRequest) Index(index int32) ApiGetAllocationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetAllocationsRequest) Wait(wait string) ApiGetAllocationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetAllocationsRequest) Stale(stale string) ApiGetAllocationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetAllocationsRequest) Prefix(prefix string) ApiGetAllocationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetAllocationsRequest) XNomadToken(xNomadToken string) ApiGetAllocationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetAllocationsRequest) PerPage(perPage int32) ApiGetAllocationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetAllocationsRequest) NextToken(nextToken string) ApiGetAllocationsRequest { r.nextToken = &nextToken return r } + +// Flag indicating whether to include resources in response. func (r ApiGetAllocationsRequest) Resources(resources bool) ApiGetAllocationsRequest { r.resources = &resources return r } + +// Flag indicating whether to include task states in response. func (r ApiGetAllocationsRequest) TaskStates(taskStates bool) ApiGetAllocationsRequest { r.taskStates = &taskStates return r } -func (r ApiGetAllocationsRequest) Execute() ([]AllocationListStub, *_nethttp.Response, error) { +func (r ApiGetAllocationsRequest) Execute() ([]AllocationListStub, *http.Response, error) { return r.ApiService.GetAllocationsExecute(r) } /* - * GetAllocations Method for GetAllocations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetAllocationsRequest - */ -func (a *AllocationsApiService) GetAllocations(ctx _context.Context) ApiGetAllocationsRequest { +GetAllocations Method for GetAllocations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllocationsRequest +*/ +func (a *AllocationsApiService) GetAllocations(ctx context.Context) ApiGetAllocationsRequest { return ApiGetAllocationsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []AllocationListStub - */ -func (a *AllocationsApiService) GetAllocationsExecute(r ApiGetAllocationsRequest) ([]AllocationListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []AllocationListStub +func (a *AllocationsApiService) GetAllocationsExecute(r ApiGetAllocationsRequest) ([]AllocationListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AllocationListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AllocationsApiService.GetAllocations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/allocations" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -576,7 +618,7 @@ func (a *AllocationsApiService) GetAllocationsExecute(r ApiGetAllocationsRequest } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -586,15 +628,15 @@ func (a *AllocationsApiService) GetAllocationsExecute(r ApiGetAllocationsRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -603,7 +645,7 @@ func (a *AllocationsApiService) GetAllocationsExecute(r ApiGetAllocationsRequest err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -614,7 +656,7 @@ func (a *AllocationsApiService) GetAllocationsExecute(r ApiGetAllocationsRequest } type ApiPostAllocationStopRequest struct { - ctx _context.Context + ctx context.Context ApiService *AllocationsApiService allocID string region *string @@ -629,58 +671,78 @@ type ApiPostAllocationStopRequest struct { noShutdownDelay *bool } +// Filters results based on the specified region. func (r ApiPostAllocationStopRequest) Region(region string) ApiPostAllocationStopRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostAllocationStopRequest) Namespace(namespace string) ApiPostAllocationStopRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiPostAllocationStopRequest) Index(index int32) ApiPostAllocationStopRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiPostAllocationStopRequest) Wait(wait string) ApiPostAllocationStopRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiPostAllocationStopRequest) Stale(stale string) ApiPostAllocationStopRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiPostAllocationStopRequest) Prefix(prefix string) ApiPostAllocationStopRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiPostAllocationStopRequest) XNomadToken(xNomadToken string) ApiPostAllocationStopRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiPostAllocationStopRequest) PerPage(perPage int32) ApiPostAllocationStopRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiPostAllocationStopRequest) NextToken(nextToken string) ApiPostAllocationStopRequest { r.nextToken = &nextToken return r } + +// Flag indicating whether to delay shutdown when requesting an allocation stop. func (r ApiPostAllocationStopRequest) NoShutdownDelay(noShutdownDelay bool) ApiPostAllocationStopRequest { r.noShutdownDelay = &noShutdownDelay return r } -func (r ApiPostAllocationStopRequest) Execute() (AllocStopResponse, *_nethttp.Response, error) { +func (r ApiPostAllocationStopRequest) Execute() (*AllocStopResponse, *http.Response, error) { return r.ApiService.PostAllocationStopExecute(r) } /* - * PostAllocationStop Method for PostAllocationStop - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param allocID Allocation ID. - * @return ApiPostAllocationStopRequest - */ -func (a *AllocationsApiService) PostAllocationStop(ctx _context.Context, allocID string) ApiPostAllocationStopRequest { +PostAllocationStop Method for PostAllocationStop + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param allocID Allocation ID. + @return ApiPostAllocationStopRequest +*/ +func (a *AllocationsApiService) PostAllocationStop(ctx context.Context, allocID string) ApiPostAllocationStopRequest { return ApiPostAllocationStopRequest{ ApiService: a, ctx: ctx, @@ -688,31 +750,27 @@ func (a *AllocationsApiService) PostAllocationStop(ctx _context.Context, allocID } } -/* - * Execute executes the request - * @return AllocStopResponse - */ -func (a *AllocationsApiService) PostAllocationStopExecute(r ApiPostAllocationStopRequest) (AllocStopResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return AllocStopResponse +func (a *AllocationsApiService) PostAllocationStopExecute(r ApiPostAllocationStopRequest) (*AllocStopResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AllocStopResponse + formFiles []formFile + localVarReturnValue *AllocStopResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AllocationsApiService.PostAllocationStop") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/allocation/{allocID}/stop" - localVarPath = strings.Replace(localVarPath, "{"+"allocID"+"}", _neturl.PathEscape(parameterToString(r.allocID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"allocID"+"}", url.PathEscape(parameterToString(r.allocID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -775,7 +833,7 @@ func (a *AllocationsApiService) PostAllocationStopExecute(r ApiPostAllocationSto } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -785,15 +843,15 @@ func (a *AllocationsApiService) PostAllocationStopExecute(r ApiPostAllocationSto return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -802,7 +860,7 @@ func (a *AllocationsApiService) PostAllocationStopExecute(r ApiPostAllocationSto err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_deployments.go b/clients/go/v1/api_deployments.go index e98b6626..9ec3c8b2 100644 --- a/clients/go/v1/api_deployments.go +++ b/clients/go/v1/api_deployments.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // DeploymentsApiService DeploymentsApi service type DeploymentsApiService service type ApiGetDeploymentRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string region *string @@ -43,54 +39,72 @@ type ApiGetDeploymentRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetDeploymentRequest) Region(region string) ApiGetDeploymentRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetDeploymentRequest) Namespace(namespace string) ApiGetDeploymentRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetDeploymentRequest) Index(index int32) ApiGetDeploymentRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetDeploymentRequest) Wait(wait string) ApiGetDeploymentRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetDeploymentRequest) Stale(stale string) ApiGetDeploymentRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetDeploymentRequest) Prefix(prefix string) ApiGetDeploymentRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetDeploymentRequest) XNomadToken(xNomadToken string) ApiGetDeploymentRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetDeploymentRequest) PerPage(perPage int32) ApiGetDeploymentRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetDeploymentRequest) NextToken(nextToken string) ApiGetDeploymentRequest { r.nextToken = &nextToken return r } -func (r ApiGetDeploymentRequest) Execute() (Deployment, *_nethttp.Response, error) { +func (r ApiGetDeploymentRequest) Execute() (*Deployment, *http.Response, error) { return r.ApiService.GetDeploymentExecute(r) } /* - * GetDeployment Method for GetDeployment - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiGetDeploymentRequest - */ -func (a *DeploymentsApiService) GetDeployment(ctx _context.Context, deploymentID string) ApiGetDeploymentRequest { +GetDeployment Method for GetDeployment + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiGetDeploymentRequest +*/ +func (a *DeploymentsApiService) GetDeployment(ctx context.Context, deploymentID string) ApiGetDeploymentRequest { return ApiGetDeploymentRequest{ ApiService: a, ctx: ctx, @@ -98,31 +112,27 @@ func (a *DeploymentsApiService) GetDeployment(ctx _context.Context, deploymentID } } -/* - * Execute executes the request - * @return Deployment - */ -func (a *DeploymentsApiService) GetDeploymentExecute(r ApiGetDeploymentRequest) (Deployment, *_nethttp.Response, error) { +// Execute executes the request +// @return Deployment +func (a *DeploymentsApiService) GetDeploymentExecute(r ApiGetDeploymentRequest) (*Deployment, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Deployment + formFiles []formFile + localVarReturnValue *Deployment ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.GetDeployment") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -182,7 +192,7 @@ func (a *DeploymentsApiService) GetDeploymentExecute(r ApiGetDeploymentRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -192,15 +202,15 @@ func (a *DeploymentsApiService) GetDeploymentExecute(r ApiGetDeploymentRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -209,7 +219,7 @@ func (a *DeploymentsApiService) GetDeploymentExecute(r ApiGetDeploymentRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -220,7 +230,7 @@ func (a *DeploymentsApiService) GetDeploymentExecute(r ApiGetDeploymentRequest) } type ApiGetDeploymentAllocationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string region *string @@ -234,54 +244,72 @@ type ApiGetDeploymentAllocationsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetDeploymentAllocationsRequest) Region(region string) ApiGetDeploymentAllocationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetDeploymentAllocationsRequest) Namespace(namespace string) ApiGetDeploymentAllocationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetDeploymentAllocationsRequest) Index(index int32) ApiGetDeploymentAllocationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetDeploymentAllocationsRequest) Wait(wait string) ApiGetDeploymentAllocationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetDeploymentAllocationsRequest) Stale(stale string) ApiGetDeploymentAllocationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetDeploymentAllocationsRequest) Prefix(prefix string) ApiGetDeploymentAllocationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetDeploymentAllocationsRequest) XNomadToken(xNomadToken string) ApiGetDeploymentAllocationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetDeploymentAllocationsRequest) PerPage(perPage int32) ApiGetDeploymentAllocationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetDeploymentAllocationsRequest) NextToken(nextToken string) ApiGetDeploymentAllocationsRequest { r.nextToken = &nextToken return r } -func (r ApiGetDeploymentAllocationsRequest) Execute() ([]AllocationListStub, *_nethttp.Response, error) { +func (r ApiGetDeploymentAllocationsRequest) Execute() ([]AllocationListStub, *http.Response, error) { return r.ApiService.GetDeploymentAllocationsExecute(r) } /* - * GetDeploymentAllocations Method for GetDeploymentAllocations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiGetDeploymentAllocationsRequest - */ -func (a *DeploymentsApiService) GetDeploymentAllocations(ctx _context.Context, deploymentID string) ApiGetDeploymentAllocationsRequest { +GetDeploymentAllocations Method for GetDeploymentAllocations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiGetDeploymentAllocationsRequest +*/ +func (a *DeploymentsApiService) GetDeploymentAllocations(ctx context.Context, deploymentID string) ApiGetDeploymentAllocationsRequest { return ApiGetDeploymentAllocationsRequest{ ApiService: a, ctx: ctx, @@ -289,31 +317,27 @@ func (a *DeploymentsApiService) GetDeploymentAllocations(ctx _context.Context, d } } -/* - * Execute executes the request - * @return []AllocationListStub - */ -func (a *DeploymentsApiService) GetDeploymentAllocationsExecute(r ApiGetDeploymentAllocationsRequest) ([]AllocationListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []AllocationListStub +func (a *DeploymentsApiService) GetDeploymentAllocationsExecute(r ApiGetDeploymentAllocationsRequest) ([]AllocationListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AllocationListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.GetDeploymentAllocations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/allocations/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -373,7 +397,7 @@ func (a *DeploymentsApiService) GetDeploymentAllocationsExecute(r ApiGetDeployme } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -383,15 +407,15 @@ func (a *DeploymentsApiService) GetDeploymentAllocationsExecute(r ApiGetDeployme return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -400,7 +424,7 @@ func (a *DeploymentsApiService) GetDeploymentAllocationsExecute(r ApiGetDeployme err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -411,7 +435,7 @@ func (a *DeploymentsApiService) GetDeploymentAllocationsExecute(r ApiGetDeployme } type ApiGetDeploymentsRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService region *string namespace *string @@ -424,83 +448,97 @@ type ApiGetDeploymentsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetDeploymentsRequest) Region(region string) ApiGetDeploymentsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetDeploymentsRequest) Namespace(namespace string) ApiGetDeploymentsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetDeploymentsRequest) Index(index int32) ApiGetDeploymentsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetDeploymentsRequest) Wait(wait string) ApiGetDeploymentsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetDeploymentsRequest) Stale(stale string) ApiGetDeploymentsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetDeploymentsRequest) Prefix(prefix string) ApiGetDeploymentsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetDeploymentsRequest) XNomadToken(xNomadToken string) ApiGetDeploymentsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetDeploymentsRequest) PerPage(perPage int32) ApiGetDeploymentsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetDeploymentsRequest) NextToken(nextToken string) ApiGetDeploymentsRequest { r.nextToken = &nextToken return r } -func (r ApiGetDeploymentsRequest) Execute() ([]Deployment, *_nethttp.Response, error) { +func (r ApiGetDeploymentsRequest) Execute() ([]Deployment, *http.Response, error) { return r.ApiService.GetDeploymentsExecute(r) } /* - * GetDeployments Method for GetDeployments - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetDeploymentsRequest - */ -func (a *DeploymentsApiService) GetDeployments(ctx _context.Context) ApiGetDeploymentsRequest { +GetDeployments Method for GetDeployments + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDeploymentsRequest +*/ +func (a *DeploymentsApiService) GetDeployments(ctx context.Context) ApiGetDeploymentsRequest { return ApiGetDeploymentsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []Deployment - */ -func (a *DeploymentsApiService) GetDeploymentsExecute(r ApiGetDeploymentsRequest) ([]Deployment, *_nethttp.Response, error) { +// Execute executes the request +// @return []Deployment +func (a *DeploymentsApiService) GetDeploymentsExecute(r ApiGetDeploymentsRequest) ([]Deployment, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Deployment ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.GetDeployments") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployments" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -560,7 +598,7 @@ func (a *DeploymentsApiService) GetDeploymentsExecute(r ApiGetDeploymentsRequest } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -570,15 +608,15 @@ func (a *DeploymentsApiService) GetDeploymentsExecute(r ApiGetDeploymentsRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -587,7 +625,7 @@ func (a *DeploymentsApiService) GetDeploymentsExecute(r ApiGetDeploymentsRequest err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -598,7 +636,7 @@ func (a *DeploymentsApiService) GetDeploymentsExecute(r ApiGetDeploymentsRequest } type ApiPostDeploymentAllocationHealthRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string deploymentAllocHealthRequest *DeploymentAllocHealthRequest @@ -612,34 +650,43 @@ func (r ApiPostDeploymentAllocationHealthRequest) DeploymentAllocHealthRequest(d r.deploymentAllocHealthRequest = &deploymentAllocHealthRequest return r } + +// Filters results based on the specified region. func (r ApiPostDeploymentAllocationHealthRequest) Region(region string) ApiPostDeploymentAllocationHealthRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostDeploymentAllocationHealthRequest) Namespace(namespace string) ApiPostDeploymentAllocationHealthRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostDeploymentAllocationHealthRequest) XNomadToken(xNomadToken string) ApiPostDeploymentAllocationHealthRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostDeploymentAllocationHealthRequest) IdempotencyToken(idempotencyToken string) ApiPostDeploymentAllocationHealthRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostDeploymentAllocationHealthRequest) Execute() (DeploymentUpdateResponse, *_nethttp.Response, error) { +func (r ApiPostDeploymentAllocationHealthRequest) Execute() (*DeploymentUpdateResponse, *http.Response, error) { return r.ApiService.PostDeploymentAllocationHealthExecute(r) } /* - * PostDeploymentAllocationHealth Method for PostDeploymentAllocationHealth - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiPostDeploymentAllocationHealthRequest - */ -func (a *DeploymentsApiService) PostDeploymentAllocationHealth(ctx _context.Context, deploymentID string) ApiPostDeploymentAllocationHealthRequest { +PostDeploymentAllocationHealth Method for PostDeploymentAllocationHealth + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiPostDeploymentAllocationHealthRequest +*/ +func (a *DeploymentsApiService) PostDeploymentAllocationHealth(ctx context.Context, deploymentID string) ApiPostDeploymentAllocationHealthRequest { return ApiPostDeploymentAllocationHealthRequest{ ApiService: a, ctx: ctx, @@ -647,31 +694,27 @@ func (a *DeploymentsApiService) PostDeploymentAllocationHealth(ctx _context.Cont } } -/* - * Execute executes the request - * @return DeploymentUpdateResponse - */ -func (a *DeploymentsApiService) PostDeploymentAllocationHealthExecute(r ApiPostDeploymentAllocationHealthRequest) (DeploymentUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return DeploymentUpdateResponse +func (a *DeploymentsApiService) PostDeploymentAllocationHealthExecute(r ApiPostDeploymentAllocationHealthRequest) (*DeploymentUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DeploymentUpdateResponse + formFiles []formFile + localVarReturnValue *DeploymentUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.PostDeploymentAllocationHealth") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/allocation-health/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.deploymentAllocHealthRequest == nil { return localVarReturnValue, nil, reportError("deploymentAllocHealthRequest is required and must be specified") } @@ -721,7 +764,7 @@ func (a *DeploymentsApiService) PostDeploymentAllocationHealthExecute(r ApiPostD } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -731,15 +774,15 @@ func (a *DeploymentsApiService) PostDeploymentAllocationHealthExecute(r ApiPostD return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -748,7 +791,7 @@ func (a *DeploymentsApiService) PostDeploymentAllocationHealthExecute(r ApiPostD err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -759,7 +802,7 @@ func (a *DeploymentsApiService) PostDeploymentAllocationHealthExecute(r ApiPostD } type ApiPostDeploymentFailRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string region *string @@ -768,34 +811,42 @@ type ApiPostDeploymentFailRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiPostDeploymentFailRequest) Region(region string) ApiPostDeploymentFailRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostDeploymentFailRequest) Namespace(namespace string) ApiPostDeploymentFailRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostDeploymentFailRequest) XNomadToken(xNomadToken string) ApiPostDeploymentFailRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostDeploymentFailRequest) IdempotencyToken(idempotencyToken string) ApiPostDeploymentFailRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostDeploymentFailRequest) Execute() (DeploymentUpdateResponse, *_nethttp.Response, error) { +func (r ApiPostDeploymentFailRequest) Execute() (*DeploymentUpdateResponse, *http.Response, error) { return r.ApiService.PostDeploymentFailExecute(r) } /* - * PostDeploymentFail Method for PostDeploymentFail - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiPostDeploymentFailRequest - */ -func (a *DeploymentsApiService) PostDeploymentFail(ctx _context.Context, deploymentID string) ApiPostDeploymentFailRequest { +PostDeploymentFail Method for PostDeploymentFail + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiPostDeploymentFailRequest +*/ +func (a *DeploymentsApiService) PostDeploymentFail(ctx context.Context, deploymentID string) ApiPostDeploymentFailRequest { return ApiPostDeploymentFailRequest{ ApiService: a, ctx: ctx, @@ -803,31 +854,27 @@ func (a *DeploymentsApiService) PostDeploymentFail(ctx _context.Context, deploym } } -/* - * Execute executes the request - * @return DeploymentUpdateResponse - */ -func (a *DeploymentsApiService) PostDeploymentFailExecute(r ApiPostDeploymentFailRequest) (DeploymentUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return DeploymentUpdateResponse +func (a *DeploymentsApiService) PostDeploymentFailExecute(r ApiPostDeploymentFailRequest) (*DeploymentUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DeploymentUpdateResponse + formFiles []formFile + localVarReturnValue *DeploymentUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.PostDeploymentFail") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/fail/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -872,7 +919,7 @@ func (a *DeploymentsApiService) PostDeploymentFailExecute(r ApiPostDeploymentFai } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -882,15 +929,15 @@ func (a *DeploymentsApiService) PostDeploymentFailExecute(r ApiPostDeploymentFai return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -899,7 +946,7 @@ func (a *DeploymentsApiService) PostDeploymentFailExecute(r ApiPostDeploymentFai err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -910,7 +957,7 @@ func (a *DeploymentsApiService) PostDeploymentFailExecute(r ApiPostDeploymentFai } type ApiPostDeploymentPauseRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string deploymentPauseRequest *DeploymentPauseRequest @@ -924,34 +971,43 @@ func (r ApiPostDeploymentPauseRequest) DeploymentPauseRequest(deploymentPauseReq r.deploymentPauseRequest = &deploymentPauseRequest return r } + +// Filters results based on the specified region. func (r ApiPostDeploymentPauseRequest) Region(region string) ApiPostDeploymentPauseRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostDeploymentPauseRequest) Namespace(namespace string) ApiPostDeploymentPauseRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostDeploymentPauseRequest) XNomadToken(xNomadToken string) ApiPostDeploymentPauseRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostDeploymentPauseRequest) IdempotencyToken(idempotencyToken string) ApiPostDeploymentPauseRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostDeploymentPauseRequest) Execute() (DeploymentUpdateResponse, *_nethttp.Response, error) { +func (r ApiPostDeploymentPauseRequest) Execute() (*DeploymentUpdateResponse, *http.Response, error) { return r.ApiService.PostDeploymentPauseExecute(r) } /* - * PostDeploymentPause Method for PostDeploymentPause - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiPostDeploymentPauseRequest - */ -func (a *DeploymentsApiService) PostDeploymentPause(ctx _context.Context, deploymentID string) ApiPostDeploymentPauseRequest { +PostDeploymentPause Method for PostDeploymentPause + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiPostDeploymentPauseRequest +*/ +func (a *DeploymentsApiService) PostDeploymentPause(ctx context.Context, deploymentID string) ApiPostDeploymentPauseRequest { return ApiPostDeploymentPauseRequest{ ApiService: a, ctx: ctx, @@ -959,31 +1015,27 @@ func (a *DeploymentsApiService) PostDeploymentPause(ctx _context.Context, deploy } } -/* - * Execute executes the request - * @return DeploymentUpdateResponse - */ -func (a *DeploymentsApiService) PostDeploymentPauseExecute(r ApiPostDeploymentPauseRequest) (DeploymentUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return DeploymentUpdateResponse +func (a *DeploymentsApiService) PostDeploymentPauseExecute(r ApiPostDeploymentPauseRequest) (*DeploymentUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DeploymentUpdateResponse + formFiles []formFile + localVarReturnValue *DeploymentUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.PostDeploymentPause") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/pause/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.deploymentPauseRequest == nil { return localVarReturnValue, nil, reportError("deploymentPauseRequest is required and must be specified") } @@ -1033,7 +1085,7 @@ func (a *DeploymentsApiService) PostDeploymentPauseExecute(r ApiPostDeploymentPa } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1043,15 +1095,15 @@ func (a *DeploymentsApiService) PostDeploymentPauseExecute(r ApiPostDeploymentPa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1060,7 +1112,7 @@ func (a *DeploymentsApiService) PostDeploymentPauseExecute(r ApiPostDeploymentPa err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1071,7 +1123,7 @@ func (a *DeploymentsApiService) PostDeploymentPauseExecute(r ApiPostDeploymentPa } type ApiPostDeploymentPromoteRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string deploymentPromoteRequest *DeploymentPromoteRequest @@ -1085,34 +1137,43 @@ func (r ApiPostDeploymentPromoteRequest) DeploymentPromoteRequest(deploymentProm r.deploymentPromoteRequest = &deploymentPromoteRequest return r } + +// Filters results based on the specified region. func (r ApiPostDeploymentPromoteRequest) Region(region string) ApiPostDeploymentPromoteRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostDeploymentPromoteRequest) Namespace(namespace string) ApiPostDeploymentPromoteRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostDeploymentPromoteRequest) XNomadToken(xNomadToken string) ApiPostDeploymentPromoteRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostDeploymentPromoteRequest) IdempotencyToken(idempotencyToken string) ApiPostDeploymentPromoteRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostDeploymentPromoteRequest) Execute() (DeploymentUpdateResponse, *_nethttp.Response, error) { +func (r ApiPostDeploymentPromoteRequest) Execute() (*DeploymentUpdateResponse, *http.Response, error) { return r.ApiService.PostDeploymentPromoteExecute(r) } /* - * PostDeploymentPromote Method for PostDeploymentPromote - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiPostDeploymentPromoteRequest - */ -func (a *DeploymentsApiService) PostDeploymentPromote(ctx _context.Context, deploymentID string) ApiPostDeploymentPromoteRequest { +PostDeploymentPromote Method for PostDeploymentPromote + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiPostDeploymentPromoteRequest +*/ +func (a *DeploymentsApiService) PostDeploymentPromote(ctx context.Context, deploymentID string) ApiPostDeploymentPromoteRequest { return ApiPostDeploymentPromoteRequest{ ApiService: a, ctx: ctx, @@ -1120,31 +1181,27 @@ func (a *DeploymentsApiService) PostDeploymentPromote(ctx _context.Context, depl } } -/* - * Execute executes the request - * @return DeploymentUpdateResponse - */ -func (a *DeploymentsApiService) PostDeploymentPromoteExecute(r ApiPostDeploymentPromoteRequest) (DeploymentUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return DeploymentUpdateResponse +func (a *DeploymentsApiService) PostDeploymentPromoteExecute(r ApiPostDeploymentPromoteRequest) (*DeploymentUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DeploymentUpdateResponse + formFiles []formFile + localVarReturnValue *DeploymentUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.PostDeploymentPromote") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/promote/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.deploymentPromoteRequest == nil { return localVarReturnValue, nil, reportError("deploymentPromoteRequest is required and must be specified") } @@ -1194,7 +1251,7 @@ func (a *DeploymentsApiService) PostDeploymentPromoteExecute(r ApiPostDeployment } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1204,15 +1261,15 @@ func (a *DeploymentsApiService) PostDeploymentPromoteExecute(r ApiPostDeployment return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1221,7 +1278,7 @@ func (a *DeploymentsApiService) PostDeploymentPromoteExecute(r ApiPostDeployment err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1232,7 +1289,7 @@ func (a *DeploymentsApiService) PostDeploymentPromoteExecute(r ApiPostDeployment } type ApiPostDeploymentUnblockRequest struct { - ctx _context.Context + ctx context.Context ApiService *DeploymentsApiService deploymentID string deploymentUnblockRequest *DeploymentUnblockRequest @@ -1246,34 +1303,43 @@ func (r ApiPostDeploymentUnblockRequest) DeploymentUnblockRequest(deploymentUnbl r.deploymentUnblockRequest = &deploymentUnblockRequest return r } + +// Filters results based on the specified region. func (r ApiPostDeploymentUnblockRequest) Region(region string) ApiPostDeploymentUnblockRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostDeploymentUnblockRequest) Namespace(namespace string) ApiPostDeploymentUnblockRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostDeploymentUnblockRequest) XNomadToken(xNomadToken string) ApiPostDeploymentUnblockRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostDeploymentUnblockRequest) IdempotencyToken(idempotencyToken string) ApiPostDeploymentUnblockRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostDeploymentUnblockRequest) Execute() (DeploymentUpdateResponse, *_nethttp.Response, error) { +func (r ApiPostDeploymentUnblockRequest) Execute() (*DeploymentUpdateResponse, *http.Response, error) { return r.ApiService.PostDeploymentUnblockExecute(r) } /* - * PostDeploymentUnblock Method for PostDeploymentUnblock - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param deploymentID Deployment ID. - * @return ApiPostDeploymentUnblockRequest - */ -func (a *DeploymentsApiService) PostDeploymentUnblock(ctx _context.Context, deploymentID string) ApiPostDeploymentUnblockRequest { +PostDeploymentUnblock Method for PostDeploymentUnblock + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deploymentID Deployment ID. + @return ApiPostDeploymentUnblockRequest +*/ +func (a *DeploymentsApiService) PostDeploymentUnblock(ctx context.Context, deploymentID string) ApiPostDeploymentUnblockRequest { return ApiPostDeploymentUnblockRequest{ ApiService: a, ctx: ctx, @@ -1281,31 +1347,27 @@ func (a *DeploymentsApiService) PostDeploymentUnblock(ctx _context.Context, depl } } -/* - * Execute executes the request - * @return DeploymentUpdateResponse - */ -func (a *DeploymentsApiService) PostDeploymentUnblockExecute(r ApiPostDeploymentUnblockRequest) (DeploymentUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return DeploymentUpdateResponse +func (a *DeploymentsApiService) PostDeploymentUnblockExecute(r ApiPostDeploymentUnblockRequest) (*DeploymentUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DeploymentUpdateResponse + formFiles []formFile + localVarReturnValue *DeploymentUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeploymentsApiService.PostDeploymentUnblock") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/deployment/unblock/{deploymentID}" - localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", _neturl.PathEscape(parameterToString(r.deploymentID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deploymentID"+"}", url.PathEscape(parameterToString(r.deploymentID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.deploymentUnblockRequest == nil { return localVarReturnValue, nil, reportError("deploymentUnblockRequest is required and must be specified") } @@ -1355,7 +1417,7 @@ func (a *DeploymentsApiService) PostDeploymentUnblockExecute(r ApiPostDeployment } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1365,15 +1427,15 @@ func (a *DeploymentsApiService) PostDeploymentUnblockExecute(r ApiPostDeployment return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1382,7 +1444,7 @@ func (a *DeploymentsApiService) PostDeploymentUnblockExecute(r ApiPostDeployment err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_enterprise.go b/clients/go/v1/api_enterprise.go index 00f34ce4..e9e85ede 100644 --- a/clients/go/v1/api_enterprise.go +++ b/clients/go/v1/api_enterprise.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // EnterpriseApiService EnterpriseApi service type EnterpriseApiService service type ApiCreateQuotaSpecRequest struct { - ctx _context.Context + ctx context.Context ApiService *EnterpriseApiService quotaSpec *QuotaSpec region *string @@ -42,61 +38,66 @@ func (r ApiCreateQuotaSpecRequest) QuotaSpec(quotaSpec QuotaSpec) ApiCreateQuota r.quotaSpec = "aSpec return r } + +// Filters results based on the specified region. func (r ApiCreateQuotaSpecRequest) Region(region string) ApiCreateQuotaSpecRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiCreateQuotaSpecRequest) Namespace(namespace string) ApiCreateQuotaSpecRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiCreateQuotaSpecRequest) XNomadToken(xNomadToken string) ApiCreateQuotaSpecRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiCreateQuotaSpecRequest) IdempotencyToken(idempotencyToken string) ApiCreateQuotaSpecRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiCreateQuotaSpecRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateQuotaSpecRequest) Execute() (*http.Response, error) { return r.ApiService.CreateQuotaSpecExecute(r) } /* - * CreateQuotaSpec Method for CreateQuotaSpec - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateQuotaSpecRequest - */ -func (a *EnterpriseApiService) CreateQuotaSpec(ctx _context.Context) ApiCreateQuotaSpecRequest { +CreateQuotaSpec Method for CreateQuotaSpec + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateQuotaSpecRequest +*/ +func (a *EnterpriseApiService) CreateQuotaSpec(ctx context.Context) ApiCreateQuotaSpecRequest { return ApiCreateQuotaSpecRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *EnterpriseApiService) CreateQuotaSpecExecute(r ApiCreateQuotaSpecRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EnterpriseApiService) CreateQuotaSpecExecute(r ApiCreateQuotaSpecRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseApiService.CreateQuotaSpec") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/quota" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.quotaSpec == nil { return nil, reportError("quotaSpec is required and must be specified") } @@ -146,7 +147,7 @@ func (a *EnterpriseApiService) CreateQuotaSpecExecute(r ApiCreateQuotaSpecReques } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -156,15 +157,15 @@ func (a *EnterpriseApiService) CreateQuotaSpecExecute(r ApiCreateQuotaSpecReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -175,7 +176,7 @@ func (a *EnterpriseApiService) CreateQuotaSpecExecute(r ApiCreateQuotaSpecReques } type ApiDeleteQuotaSpecRequest struct { - ctx _context.Context + ctx context.Context ApiService *EnterpriseApiService specName string region *string @@ -184,34 +185,42 @@ type ApiDeleteQuotaSpecRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiDeleteQuotaSpecRequest) Region(region string) ApiDeleteQuotaSpecRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteQuotaSpecRequest) Namespace(namespace string) ApiDeleteQuotaSpecRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteQuotaSpecRequest) XNomadToken(xNomadToken string) ApiDeleteQuotaSpecRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteQuotaSpecRequest) IdempotencyToken(idempotencyToken string) ApiDeleteQuotaSpecRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiDeleteQuotaSpecRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteQuotaSpecRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteQuotaSpecExecute(r) } /* - * DeleteQuotaSpec Method for DeleteQuotaSpec - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param specName The quota spec identifier. - * @return ApiDeleteQuotaSpecRequest - */ -func (a *EnterpriseApiService) DeleteQuotaSpec(ctx _context.Context, specName string) ApiDeleteQuotaSpecRequest { +DeleteQuotaSpec Method for DeleteQuotaSpec + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param specName The quota spec identifier. + @return ApiDeleteQuotaSpecRequest +*/ +func (a *EnterpriseApiService) DeleteQuotaSpec(ctx context.Context, specName string) ApiDeleteQuotaSpecRequest { return ApiDeleteQuotaSpecRequest{ ApiService: a, ctx: ctx, @@ -219,29 +228,25 @@ func (a *EnterpriseApiService) DeleteQuotaSpec(ctx _context.Context, specName st } } -/* - * Execute executes the request - */ -func (a *EnterpriseApiService) DeleteQuotaSpecExecute(r ApiDeleteQuotaSpecRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EnterpriseApiService) DeleteQuotaSpecExecute(r ApiDeleteQuotaSpecRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseApiService.DeleteQuotaSpec") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/quota/{specName}" - localVarPath = strings.Replace(localVarPath, "{"+"specName"+"}", _neturl.PathEscape(parameterToString(r.specName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"specName"+"}", url.PathEscape(parameterToString(r.specName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -286,7 +291,7 @@ func (a *EnterpriseApiService) DeleteQuotaSpecExecute(r ApiDeleteQuotaSpecReques } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -296,15 +301,15 @@ func (a *EnterpriseApiService) DeleteQuotaSpecExecute(r ApiDeleteQuotaSpecReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -315,7 +320,7 @@ func (a *EnterpriseApiService) DeleteQuotaSpecExecute(r ApiDeleteQuotaSpecReques } type ApiGetQuotaSpecRequest struct { - ctx _context.Context + ctx context.Context ApiService *EnterpriseApiService specName string region *string @@ -329,54 +334,72 @@ type ApiGetQuotaSpecRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetQuotaSpecRequest) Region(region string) ApiGetQuotaSpecRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetQuotaSpecRequest) Namespace(namespace string) ApiGetQuotaSpecRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetQuotaSpecRequest) Index(index int32) ApiGetQuotaSpecRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetQuotaSpecRequest) Wait(wait string) ApiGetQuotaSpecRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetQuotaSpecRequest) Stale(stale string) ApiGetQuotaSpecRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetQuotaSpecRequest) Prefix(prefix string) ApiGetQuotaSpecRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetQuotaSpecRequest) XNomadToken(xNomadToken string) ApiGetQuotaSpecRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetQuotaSpecRequest) PerPage(perPage int32) ApiGetQuotaSpecRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetQuotaSpecRequest) NextToken(nextToken string) ApiGetQuotaSpecRequest { r.nextToken = &nextToken return r } -func (r ApiGetQuotaSpecRequest) Execute() (QuotaSpec, *_nethttp.Response, error) { +func (r ApiGetQuotaSpecRequest) Execute() (*QuotaSpec, *http.Response, error) { return r.ApiService.GetQuotaSpecExecute(r) } /* - * GetQuotaSpec Method for GetQuotaSpec - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param specName The quota spec identifier. - * @return ApiGetQuotaSpecRequest - */ -func (a *EnterpriseApiService) GetQuotaSpec(ctx _context.Context, specName string) ApiGetQuotaSpecRequest { +GetQuotaSpec Method for GetQuotaSpec + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param specName The quota spec identifier. + @return ApiGetQuotaSpecRequest +*/ +func (a *EnterpriseApiService) GetQuotaSpec(ctx context.Context, specName string) ApiGetQuotaSpecRequest { return ApiGetQuotaSpecRequest{ ApiService: a, ctx: ctx, @@ -384,31 +407,27 @@ func (a *EnterpriseApiService) GetQuotaSpec(ctx _context.Context, specName strin } } -/* - * Execute executes the request - * @return QuotaSpec - */ -func (a *EnterpriseApiService) GetQuotaSpecExecute(r ApiGetQuotaSpecRequest) (QuotaSpec, *_nethttp.Response, error) { +// Execute executes the request +// @return QuotaSpec +func (a *EnterpriseApiService) GetQuotaSpecExecute(r ApiGetQuotaSpecRequest) (*QuotaSpec, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue QuotaSpec + formFiles []formFile + localVarReturnValue *QuotaSpec ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseApiService.GetQuotaSpec") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/quota/{specName}" - localVarPath = strings.Replace(localVarPath, "{"+"specName"+"}", _neturl.PathEscape(parameterToString(r.specName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"specName"+"}", url.PathEscape(parameterToString(r.specName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -468,7 +487,7 @@ func (a *EnterpriseApiService) GetQuotaSpecExecute(r ApiGetQuotaSpecRequest) (Qu } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -478,15 +497,15 @@ func (a *EnterpriseApiService) GetQuotaSpecExecute(r ApiGetQuotaSpecRequest) (Qu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -495,7 +514,7 @@ func (a *EnterpriseApiService) GetQuotaSpecExecute(r ApiGetQuotaSpecRequest) (Qu err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -506,7 +525,7 @@ func (a *EnterpriseApiService) GetQuotaSpecExecute(r ApiGetQuotaSpecRequest) (Qu } type ApiGetQuotasRequest struct { - ctx _context.Context + ctx context.Context ApiService *EnterpriseApiService region *string namespace *string @@ -519,83 +538,97 @@ type ApiGetQuotasRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetQuotasRequest) Region(region string) ApiGetQuotasRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetQuotasRequest) Namespace(namespace string) ApiGetQuotasRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetQuotasRequest) Index(index int32) ApiGetQuotasRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetQuotasRequest) Wait(wait string) ApiGetQuotasRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetQuotasRequest) Stale(stale string) ApiGetQuotasRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetQuotasRequest) Prefix(prefix string) ApiGetQuotasRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetQuotasRequest) XNomadToken(xNomadToken string) ApiGetQuotasRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetQuotasRequest) PerPage(perPage int32) ApiGetQuotasRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetQuotasRequest) NextToken(nextToken string) ApiGetQuotasRequest { r.nextToken = &nextToken return r } -func (r ApiGetQuotasRequest) Execute() ([]interface{}, *_nethttp.Response, error) { +func (r ApiGetQuotasRequest) Execute() ([]interface{}, *http.Response, error) { return r.ApiService.GetQuotasExecute(r) } /* - * GetQuotas Method for GetQuotas - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetQuotasRequest - */ -func (a *EnterpriseApiService) GetQuotas(ctx _context.Context) ApiGetQuotasRequest { +GetQuotas Method for GetQuotas + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetQuotasRequest +*/ +func (a *EnterpriseApiService) GetQuotas(ctx context.Context) ApiGetQuotasRequest { return ApiGetQuotasRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []interface{} - */ -func (a *EnterpriseApiService) GetQuotasExecute(r ApiGetQuotasRequest) ([]interface{}, *_nethttp.Response, error) { +// Execute executes the request +// @return []interface{} +func (a *EnterpriseApiService) GetQuotasExecute(r ApiGetQuotasRequest) ([]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseApiService.GetQuotas") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/quotas" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -655,7 +688,7 @@ func (a *EnterpriseApiService) GetQuotasExecute(r ApiGetQuotasRequest) ([]interf } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -665,15 +698,15 @@ func (a *EnterpriseApiService) GetQuotasExecute(r ApiGetQuotasRequest) ([]interf return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -682,7 +715,7 @@ func (a *EnterpriseApiService) GetQuotasExecute(r ApiGetQuotasRequest) ([]interf err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -693,7 +726,7 @@ func (a *EnterpriseApiService) GetQuotasExecute(r ApiGetQuotasRequest) ([]interf } type ApiPostQuotaSpecRequest struct { - ctx _context.Context + ctx context.Context ApiService *EnterpriseApiService specName string quotaSpec *QuotaSpec @@ -707,34 +740,43 @@ func (r ApiPostQuotaSpecRequest) QuotaSpec(quotaSpec QuotaSpec) ApiPostQuotaSpec r.quotaSpec = "aSpec return r } + +// Filters results based on the specified region. func (r ApiPostQuotaSpecRequest) Region(region string) ApiPostQuotaSpecRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostQuotaSpecRequest) Namespace(namespace string) ApiPostQuotaSpecRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostQuotaSpecRequest) XNomadToken(xNomadToken string) ApiPostQuotaSpecRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostQuotaSpecRequest) IdempotencyToken(idempotencyToken string) ApiPostQuotaSpecRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostQuotaSpecRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPostQuotaSpecRequest) Execute() (*http.Response, error) { return r.ApiService.PostQuotaSpecExecute(r) } /* - * PostQuotaSpec Method for PostQuotaSpec - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param specName The quota spec identifier. - * @return ApiPostQuotaSpecRequest - */ -func (a *EnterpriseApiService) PostQuotaSpec(ctx _context.Context, specName string) ApiPostQuotaSpecRequest { +PostQuotaSpec Method for PostQuotaSpec + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param specName The quota spec identifier. + @return ApiPostQuotaSpecRequest +*/ +func (a *EnterpriseApiService) PostQuotaSpec(ctx context.Context, specName string) ApiPostQuotaSpecRequest { return ApiPostQuotaSpecRequest{ ApiService: a, ctx: ctx, @@ -742,29 +784,25 @@ func (a *EnterpriseApiService) PostQuotaSpec(ctx _context.Context, specName stri } } -/* - * Execute executes the request - */ -func (a *EnterpriseApiService) PostQuotaSpecExecute(r ApiPostQuotaSpecRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EnterpriseApiService) PostQuotaSpecExecute(r ApiPostQuotaSpecRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseApiService.PostQuotaSpec") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/quota/{specName}" - localVarPath = strings.Replace(localVarPath, "{"+"specName"+"}", _neturl.PathEscape(parameterToString(r.specName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"specName"+"}", url.PathEscape(parameterToString(r.specName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.quotaSpec == nil { return nil, reportError("quotaSpec is required and must be specified") } @@ -814,7 +852,7 @@ func (a *EnterpriseApiService) PostQuotaSpecExecute(r ApiPostQuotaSpecRequest) ( } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -824,15 +862,15 @@ func (a *EnterpriseApiService) PostQuotaSpecExecute(r ApiPostQuotaSpecRequest) ( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/clients/go/v1/api_evaluations.go b/clients/go/v1/api_evaluations.go index 3565bb97..9871c163 100644 --- a/clients/go/v1/api_evaluations.go +++ b/clients/go/v1/api_evaluations.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // EvaluationsApiService EvaluationsApi service type EvaluationsApiService service type ApiGetEvaluationRequest struct { - ctx _context.Context + ctx context.Context ApiService *EvaluationsApiService evalID string region *string @@ -43,54 +39,72 @@ type ApiGetEvaluationRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetEvaluationRequest) Region(region string) ApiGetEvaluationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetEvaluationRequest) Namespace(namespace string) ApiGetEvaluationRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetEvaluationRequest) Index(index int32) ApiGetEvaluationRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetEvaluationRequest) Wait(wait string) ApiGetEvaluationRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetEvaluationRequest) Stale(stale string) ApiGetEvaluationRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetEvaluationRequest) Prefix(prefix string) ApiGetEvaluationRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetEvaluationRequest) XNomadToken(xNomadToken string) ApiGetEvaluationRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetEvaluationRequest) PerPage(perPage int32) ApiGetEvaluationRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetEvaluationRequest) NextToken(nextToken string) ApiGetEvaluationRequest { r.nextToken = &nextToken return r } -func (r ApiGetEvaluationRequest) Execute() (Evaluation, *_nethttp.Response, error) { +func (r ApiGetEvaluationRequest) Execute() (*Evaluation, *http.Response, error) { return r.ApiService.GetEvaluationExecute(r) } /* - * GetEvaluation Method for GetEvaluation - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param evalID Evaluation ID. - * @return ApiGetEvaluationRequest - */ -func (a *EvaluationsApiService) GetEvaluation(ctx _context.Context, evalID string) ApiGetEvaluationRequest { +GetEvaluation Method for GetEvaluation + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param evalID Evaluation ID. + @return ApiGetEvaluationRequest +*/ +func (a *EvaluationsApiService) GetEvaluation(ctx context.Context, evalID string) ApiGetEvaluationRequest { return ApiGetEvaluationRequest{ ApiService: a, ctx: ctx, @@ -98,31 +112,27 @@ func (a *EvaluationsApiService) GetEvaluation(ctx _context.Context, evalID strin } } -/* - * Execute executes the request - * @return Evaluation - */ -func (a *EvaluationsApiService) GetEvaluationExecute(r ApiGetEvaluationRequest) (Evaluation, *_nethttp.Response, error) { +// Execute executes the request +// @return Evaluation +func (a *EvaluationsApiService) GetEvaluationExecute(r ApiGetEvaluationRequest) (*Evaluation, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Evaluation + formFiles []formFile + localVarReturnValue *Evaluation ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EvaluationsApiService.GetEvaluation") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/evaluation/{evalID}" - localVarPath = strings.Replace(localVarPath, "{"+"evalID"+"}", _neturl.PathEscape(parameterToString(r.evalID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"evalID"+"}", url.PathEscape(parameterToString(r.evalID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -182,7 +192,7 @@ func (a *EvaluationsApiService) GetEvaluationExecute(r ApiGetEvaluationRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -192,15 +202,15 @@ func (a *EvaluationsApiService) GetEvaluationExecute(r ApiGetEvaluationRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -209,7 +219,7 @@ func (a *EvaluationsApiService) GetEvaluationExecute(r ApiGetEvaluationRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -220,7 +230,7 @@ func (a *EvaluationsApiService) GetEvaluationExecute(r ApiGetEvaluationRequest) } type ApiGetEvaluationAllocationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *EvaluationsApiService evalID string region *string @@ -234,54 +244,72 @@ type ApiGetEvaluationAllocationsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetEvaluationAllocationsRequest) Region(region string) ApiGetEvaluationAllocationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetEvaluationAllocationsRequest) Namespace(namespace string) ApiGetEvaluationAllocationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetEvaluationAllocationsRequest) Index(index int32) ApiGetEvaluationAllocationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetEvaluationAllocationsRequest) Wait(wait string) ApiGetEvaluationAllocationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetEvaluationAllocationsRequest) Stale(stale string) ApiGetEvaluationAllocationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetEvaluationAllocationsRequest) Prefix(prefix string) ApiGetEvaluationAllocationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetEvaluationAllocationsRequest) XNomadToken(xNomadToken string) ApiGetEvaluationAllocationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetEvaluationAllocationsRequest) PerPage(perPage int32) ApiGetEvaluationAllocationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetEvaluationAllocationsRequest) NextToken(nextToken string) ApiGetEvaluationAllocationsRequest { r.nextToken = &nextToken return r } -func (r ApiGetEvaluationAllocationsRequest) Execute() ([]AllocationListStub, *_nethttp.Response, error) { +func (r ApiGetEvaluationAllocationsRequest) Execute() ([]AllocationListStub, *http.Response, error) { return r.ApiService.GetEvaluationAllocationsExecute(r) } /* - * GetEvaluationAllocations Method for GetEvaluationAllocations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param evalID Evaluation ID. - * @return ApiGetEvaluationAllocationsRequest - */ -func (a *EvaluationsApiService) GetEvaluationAllocations(ctx _context.Context, evalID string) ApiGetEvaluationAllocationsRequest { +GetEvaluationAllocations Method for GetEvaluationAllocations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param evalID Evaluation ID. + @return ApiGetEvaluationAllocationsRequest +*/ +func (a *EvaluationsApiService) GetEvaluationAllocations(ctx context.Context, evalID string) ApiGetEvaluationAllocationsRequest { return ApiGetEvaluationAllocationsRequest{ ApiService: a, ctx: ctx, @@ -289,31 +317,27 @@ func (a *EvaluationsApiService) GetEvaluationAllocations(ctx _context.Context, e } } -/* - * Execute executes the request - * @return []AllocationListStub - */ -func (a *EvaluationsApiService) GetEvaluationAllocationsExecute(r ApiGetEvaluationAllocationsRequest) ([]AllocationListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []AllocationListStub +func (a *EvaluationsApiService) GetEvaluationAllocationsExecute(r ApiGetEvaluationAllocationsRequest) ([]AllocationListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AllocationListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EvaluationsApiService.GetEvaluationAllocations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/evaluation/{evalID}/allocations" - localVarPath = strings.Replace(localVarPath, "{"+"evalID"+"}", _neturl.PathEscape(parameterToString(r.evalID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"evalID"+"}", url.PathEscape(parameterToString(r.evalID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -373,7 +397,7 @@ func (a *EvaluationsApiService) GetEvaluationAllocationsExecute(r ApiGetEvaluati } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -383,15 +407,15 @@ func (a *EvaluationsApiService) GetEvaluationAllocationsExecute(r ApiGetEvaluati return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -400,7 +424,7 @@ func (a *EvaluationsApiService) GetEvaluationAllocationsExecute(r ApiGetEvaluati err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -411,7 +435,7 @@ func (a *EvaluationsApiService) GetEvaluationAllocationsExecute(r ApiGetEvaluati } type ApiGetEvaluationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *EvaluationsApiService region *string namespace *string @@ -424,83 +448,97 @@ type ApiGetEvaluationsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetEvaluationsRequest) Region(region string) ApiGetEvaluationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetEvaluationsRequest) Namespace(namespace string) ApiGetEvaluationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetEvaluationsRequest) Index(index int32) ApiGetEvaluationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetEvaluationsRequest) Wait(wait string) ApiGetEvaluationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetEvaluationsRequest) Stale(stale string) ApiGetEvaluationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetEvaluationsRequest) Prefix(prefix string) ApiGetEvaluationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetEvaluationsRequest) XNomadToken(xNomadToken string) ApiGetEvaluationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetEvaluationsRequest) PerPage(perPage int32) ApiGetEvaluationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetEvaluationsRequest) NextToken(nextToken string) ApiGetEvaluationsRequest { r.nextToken = &nextToken return r } -func (r ApiGetEvaluationsRequest) Execute() ([]Evaluation, *_nethttp.Response, error) { +func (r ApiGetEvaluationsRequest) Execute() ([]Evaluation, *http.Response, error) { return r.ApiService.GetEvaluationsExecute(r) } /* - * GetEvaluations Method for GetEvaluations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetEvaluationsRequest - */ -func (a *EvaluationsApiService) GetEvaluations(ctx _context.Context) ApiGetEvaluationsRequest { +GetEvaluations Method for GetEvaluations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetEvaluationsRequest +*/ +func (a *EvaluationsApiService) GetEvaluations(ctx context.Context) ApiGetEvaluationsRequest { return ApiGetEvaluationsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []Evaluation - */ -func (a *EvaluationsApiService) GetEvaluationsExecute(r ApiGetEvaluationsRequest) ([]Evaluation, *_nethttp.Response, error) { +// Execute executes the request +// @return []Evaluation +func (a *EvaluationsApiService) GetEvaluationsExecute(r ApiGetEvaluationsRequest) ([]Evaluation, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Evaluation ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EvaluationsApiService.GetEvaluations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/evaluations" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -560,7 +598,7 @@ func (a *EvaluationsApiService) GetEvaluationsExecute(r ApiGetEvaluationsRequest } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -570,15 +608,15 @@ func (a *EvaluationsApiService) GetEvaluationsExecute(r ApiGetEvaluationsRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -587,7 +625,7 @@ func (a *EvaluationsApiService) GetEvaluationsExecute(r ApiGetEvaluationsRequest err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_jobs.go b/clients/go/v1/api_jobs.go index d354d249..aa57ccf9 100644 --- a/clients/go/v1/api_jobs.go +++ b/clients/go/v1/api_jobs.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // JobsApiService JobsApi service type JobsApiService service type ApiDeleteJobRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -40,42 +36,54 @@ type ApiDeleteJobRequest struct { global *bool } +// Filters results based on the specified region. func (r ApiDeleteJobRequest) Region(region string) ApiDeleteJobRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteJobRequest) Namespace(namespace string) ApiDeleteJobRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteJobRequest) XNomadToken(xNomadToken string) ApiDeleteJobRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteJobRequest) IdempotencyToken(idempotencyToken string) ApiDeleteJobRequest { r.idempotencyToken = &idempotencyToken return r } + +// Boolean flag indicating whether to purge allocations of the job after deleting. func (r ApiDeleteJobRequest) Purge(purge bool) ApiDeleteJobRequest { r.purge = &purge return r } + +// Boolean flag indicating whether the operation should apply to all instances of the job globally. func (r ApiDeleteJobRequest) Global(global bool) ApiDeleteJobRequest { r.global = &global return r } -func (r ApiDeleteJobRequest) Execute() (JobDeregisterResponse, *_nethttp.Response, error) { +func (r ApiDeleteJobRequest) Execute() (*JobDeregisterResponse, *http.Response, error) { return r.ApiService.DeleteJobExecute(r) } /* - * DeleteJob Method for DeleteJob - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiDeleteJobRequest - */ -func (a *JobsApiService) DeleteJob(ctx _context.Context, jobName string) ApiDeleteJobRequest { +DeleteJob Method for DeleteJob + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiDeleteJobRequest +*/ +func (a *JobsApiService) DeleteJob(ctx context.Context, jobName string) ApiDeleteJobRequest { return ApiDeleteJobRequest{ ApiService: a, ctx: ctx, @@ -83,31 +91,27 @@ func (a *JobsApiService) DeleteJob(ctx _context.Context, jobName string) ApiDele } } -/* - * Execute executes the request - * @return JobDeregisterResponse - */ -func (a *JobsApiService) DeleteJobExecute(r ApiDeleteJobRequest) (JobDeregisterResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobDeregisterResponse +func (a *JobsApiService) DeleteJobExecute(r ApiDeleteJobRequest) (*JobDeregisterResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobDeregisterResponse + formFiles []formFile + localVarReturnValue *JobDeregisterResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.DeleteJob") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -158,7 +162,7 @@ func (a *JobsApiService) DeleteJobExecute(r ApiDeleteJobRequest) (JobDeregisterR } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -168,15 +172,15 @@ func (a *JobsApiService) DeleteJobExecute(r ApiDeleteJobRequest) (JobDeregisterR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -185,7 +189,7 @@ func (a *JobsApiService) DeleteJobExecute(r ApiDeleteJobRequest) (JobDeregisterR err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -196,7 +200,7 @@ func (a *JobsApiService) DeleteJobExecute(r ApiDeleteJobRequest) (JobDeregisterR } type ApiGetJobRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -210,54 +214,72 @@ type ApiGetJobRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetJobRequest) Region(region string) ApiGetJobRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobRequest) Namespace(namespace string) ApiGetJobRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobRequest) Index(index int32) ApiGetJobRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobRequest) Wait(wait string) ApiGetJobRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobRequest) Stale(stale string) ApiGetJobRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobRequest) Prefix(prefix string) ApiGetJobRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobRequest) XNomadToken(xNomadToken string) ApiGetJobRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobRequest) PerPage(perPage int32) ApiGetJobRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobRequest) NextToken(nextToken string) ApiGetJobRequest { r.nextToken = &nextToken return r } -func (r ApiGetJobRequest) Execute() (Job, *_nethttp.Response, error) { +func (r ApiGetJobRequest) Execute() (*Job, *http.Response, error) { return r.ApiService.GetJobExecute(r) } /* - * GetJob Method for GetJob - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobRequest - */ -func (a *JobsApiService) GetJob(ctx _context.Context, jobName string) ApiGetJobRequest { +GetJob Method for GetJob + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobRequest +*/ +func (a *JobsApiService) GetJob(ctx context.Context, jobName string) ApiGetJobRequest { return ApiGetJobRequest{ ApiService: a, ctx: ctx, @@ -265,31 +287,27 @@ func (a *JobsApiService) GetJob(ctx _context.Context, jobName string) ApiGetJobR } } -/* - * Execute executes the request - * @return Job - */ -func (a *JobsApiService) GetJobExecute(r ApiGetJobRequest) (Job, *_nethttp.Response, error) { +// Execute executes the request +// @return Job +func (a *JobsApiService) GetJobExecute(r ApiGetJobRequest) (*Job, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Job + formFiles []formFile + localVarReturnValue *Job ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJob") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -349,7 +367,7 @@ func (a *JobsApiService) GetJobExecute(r ApiGetJobRequest) (Job, *_nethttp.Respo } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -359,15 +377,15 @@ func (a *JobsApiService) GetJobExecute(r ApiGetJobRequest) (Job, *_nethttp.Respo return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -376,7 +394,7 @@ func (a *JobsApiService) GetJobExecute(r ApiGetJobRequest) (Job, *_nethttp.Respo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -387,7 +405,7 @@ func (a *JobsApiService) GetJobExecute(r ApiGetJobRequest) (Job, *_nethttp.Respo } type ApiGetJobAllocationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -402,58 +420,78 @@ type ApiGetJobAllocationsRequest struct { all *bool } +// Filters results based on the specified region. func (r ApiGetJobAllocationsRequest) Region(region string) ApiGetJobAllocationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobAllocationsRequest) Namespace(namespace string) ApiGetJobAllocationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobAllocationsRequest) Index(index int32) ApiGetJobAllocationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobAllocationsRequest) Wait(wait string) ApiGetJobAllocationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobAllocationsRequest) Stale(stale string) ApiGetJobAllocationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobAllocationsRequest) Prefix(prefix string) ApiGetJobAllocationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobAllocationsRequest) XNomadToken(xNomadToken string) ApiGetJobAllocationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobAllocationsRequest) PerPage(perPage int32) ApiGetJobAllocationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobAllocationsRequest) NextToken(nextToken string) ApiGetJobAllocationsRequest { r.nextToken = &nextToken return r } + +// Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered. func (r ApiGetJobAllocationsRequest) All(all bool) ApiGetJobAllocationsRequest { r.all = &all return r } -func (r ApiGetJobAllocationsRequest) Execute() ([]AllocationListStub, *_nethttp.Response, error) { +func (r ApiGetJobAllocationsRequest) Execute() ([]AllocationListStub, *http.Response, error) { return r.ApiService.GetJobAllocationsExecute(r) } /* - * GetJobAllocations Method for GetJobAllocations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobAllocationsRequest - */ -func (a *JobsApiService) GetJobAllocations(ctx _context.Context, jobName string) ApiGetJobAllocationsRequest { +GetJobAllocations Method for GetJobAllocations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobAllocationsRequest +*/ +func (a *JobsApiService) GetJobAllocations(ctx context.Context, jobName string) ApiGetJobAllocationsRequest { return ApiGetJobAllocationsRequest{ ApiService: a, ctx: ctx, @@ -461,31 +499,27 @@ func (a *JobsApiService) GetJobAllocations(ctx _context.Context, jobName string) } } -/* - * Execute executes the request - * @return []AllocationListStub - */ -func (a *JobsApiService) GetJobAllocationsExecute(r ApiGetJobAllocationsRequest) ([]AllocationListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []AllocationListStub +func (a *JobsApiService) GetJobAllocationsExecute(r ApiGetJobAllocationsRequest) ([]AllocationListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AllocationListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobAllocations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/allocations" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -548,7 +582,7 @@ func (a *JobsApiService) GetJobAllocationsExecute(r ApiGetJobAllocationsRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -558,15 +592,15 @@ func (a *JobsApiService) GetJobAllocationsExecute(r ApiGetJobAllocationsRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -575,7 +609,7 @@ func (a *JobsApiService) GetJobAllocationsExecute(r ApiGetJobAllocationsRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -586,7 +620,7 @@ func (a *JobsApiService) GetJobAllocationsExecute(r ApiGetJobAllocationsRequest) } type ApiGetJobDeploymentRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -600,54 +634,72 @@ type ApiGetJobDeploymentRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetJobDeploymentRequest) Region(region string) ApiGetJobDeploymentRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobDeploymentRequest) Namespace(namespace string) ApiGetJobDeploymentRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobDeploymentRequest) Index(index int32) ApiGetJobDeploymentRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobDeploymentRequest) Wait(wait string) ApiGetJobDeploymentRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobDeploymentRequest) Stale(stale string) ApiGetJobDeploymentRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobDeploymentRequest) Prefix(prefix string) ApiGetJobDeploymentRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobDeploymentRequest) XNomadToken(xNomadToken string) ApiGetJobDeploymentRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobDeploymentRequest) PerPage(perPage int32) ApiGetJobDeploymentRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobDeploymentRequest) NextToken(nextToken string) ApiGetJobDeploymentRequest { r.nextToken = &nextToken return r } -func (r ApiGetJobDeploymentRequest) Execute() (Deployment, *_nethttp.Response, error) { +func (r ApiGetJobDeploymentRequest) Execute() (*Deployment, *http.Response, error) { return r.ApiService.GetJobDeploymentExecute(r) } /* - * GetJobDeployment Method for GetJobDeployment - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobDeploymentRequest - */ -func (a *JobsApiService) GetJobDeployment(ctx _context.Context, jobName string) ApiGetJobDeploymentRequest { +GetJobDeployment Method for GetJobDeployment + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobDeploymentRequest +*/ +func (a *JobsApiService) GetJobDeployment(ctx context.Context, jobName string) ApiGetJobDeploymentRequest { return ApiGetJobDeploymentRequest{ ApiService: a, ctx: ctx, @@ -655,31 +707,27 @@ func (a *JobsApiService) GetJobDeployment(ctx _context.Context, jobName string) } } -/* - * Execute executes the request - * @return Deployment - */ -func (a *JobsApiService) GetJobDeploymentExecute(r ApiGetJobDeploymentRequest) (Deployment, *_nethttp.Response, error) { +// Execute executes the request +// @return Deployment +func (a *JobsApiService) GetJobDeploymentExecute(r ApiGetJobDeploymentRequest) (*Deployment, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Deployment + formFiles []formFile + localVarReturnValue *Deployment ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobDeployment") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/deployment" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -739,7 +787,7 @@ func (a *JobsApiService) GetJobDeploymentExecute(r ApiGetJobDeploymentRequest) ( } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -749,15 +797,15 @@ func (a *JobsApiService) GetJobDeploymentExecute(r ApiGetJobDeploymentRequest) ( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -766,7 +814,7 @@ func (a *JobsApiService) GetJobDeploymentExecute(r ApiGetJobDeploymentRequest) ( err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -777,7 +825,7 @@ func (a *JobsApiService) GetJobDeploymentExecute(r ApiGetJobDeploymentRequest) ( } type ApiGetJobDeploymentsRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -792,58 +840,78 @@ type ApiGetJobDeploymentsRequest struct { all *int32 } +// Filters results based on the specified region. func (r ApiGetJobDeploymentsRequest) Region(region string) ApiGetJobDeploymentsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobDeploymentsRequest) Namespace(namespace string) ApiGetJobDeploymentsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobDeploymentsRequest) Index(index int32) ApiGetJobDeploymentsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobDeploymentsRequest) Wait(wait string) ApiGetJobDeploymentsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobDeploymentsRequest) Stale(stale string) ApiGetJobDeploymentsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobDeploymentsRequest) Prefix(prefix string) ApiGetJobDeploymentsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobDeploymentsRequest) XNomadToken(xNomadToken string) ApiGetJobDeploymentsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobDeploymentsRequest) PerPage(perPage int32) ApiGetJobDeploymentsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobDeploymentsRequest) NextToken(nextToken string) ApiGetJobDeploymentsRequest { r.nextToken = &nextToken return r } + +// Flag indicating whether to constrain by job creation index or not. func (r ApiGetJobDeploymentsRequest) All(all int32) ApiGetJobDeploymentsRequest { r.all = &all return r } -func (r ApiGetJobDeploymentsRequest) Execute() ([]Deployment, *_nethttp.Response, error) { +func (r ApiGetJobDeploymentsRequest) Execute() ([]Deployment, *http.Response, error) { return r.ApiService.GetJobDeploymentsExecute(r) } /* - * GetJobDeployments Method for GetJobDeployments - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobDeploymentsRequest - */ -func (a *JobsApiService) GetJobDeployments(ctx _context.Context, jobName string) ApiGetJobDeploymentsRequest { +GetJobDeployments Method for GetJobDeployments + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobDeploymentsRequest +*/ +func (a *JobsApiService) GetJobDeployments(ctx context.Context, jobName string) ApiGetJobDeploymentsRequest { return ApiGetJobDeploymentsRequest{ ApiService: a, ctx: ctx, @@ -851,31 +919,27 @@ func (a *JobsApiService) GetJobDeployments(ctx _context.Context, jobName string) } } -/* - * Execute executes the request - * @return []Deployment - */ -func (a *JobsApiService) GetJobDeploymentsExecute(r ApiGetJobDeploymentsRequest) ([]Deployment, *_nethttp.Response, error) { +// Execute executes the request +// @return []Deployment +func (a *JobsApiService) GetJobDeploymentsExecute(r ApiGetJobDeploymentsRequest) ([]Deployment, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Deployment ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobDeployments") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/deployments" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -938,7 +1002,7 @@ func (a *JobsApiService) GetJobDeploymentsExecute(r ApiGetJobDeploymentsRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -948,15 +1012,15 @@ func (a *JobsApiService) GetJobDeploymentsExecute(r ApiGetJobDeploymentsRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -965,7 +1029,7 @@ func (a *JobsApiService) GetJobDeploymentsExecute(r ApiGetJobDeploymentsRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -976,7 +1040,7 @@ func (a *JobsApiService) GetJobDeploymentsExecute(r ApiGetJobDeploymentsRequest) } type ApiGetJobEvaluationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -990,54 +1054,72 @@ type ApiGetJobEvaluationsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetJobEvaluationsRequest) Region(region string) ApiGetJobEvaluationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobEvaluationsRequest) Namespace(namespace string) ApiGetJobEvaluationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobEvaluationsRequest) Index(index int32) ApiGetJobEvaluationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobEvaluationsRequest) Wait(wait string) ApiGetJobEvaluationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobEvaluationsRequest) Stale(stale string) ApiGetJobEvaluationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobEvaluationsRequest) Prefix(prefix string) ApiGetJobEvaluationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobEvaluationsRequest) XNomadToken(xNomadToken string) ApiGetJobEvaluationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobEvaluationsRequest) PerPage(perPage int32) ApiGetJobEvaluationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobEvaluationsRequest) NextToken(nextToken string) ApiGetJobEvaluationsRequest { r.nextToken = &nextToken return r } -func (r ApiGetJobEvaluationsRequest) Execute() ([]Evaluation, *_nethttp.Response, error) { +func (r ApiGetJobEvaluationsRequest) Execute() ([]Evaluation, *http.Response, error) { return r.ApiService.GetJobEvaluationsExecute(r) } /* - * GetJobEvaluations Method for GetJobEvaluations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobEvaluationsRequest - */ -func (a *JobsApiService) GetJobEvaluations(ctx _context.Context, jobName string) ApiGetJobEvaluationsRequest { +GetJobEvaluations Method for GetJobEvaluations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobEvaluationsRequest +*/ +func (a *JobsApiService) GetJobEvaluations(ctx context.Context, jobName string) ApiGetJobEvaluationsRequest { return ApiGetJobEvaluationsRequest{ ApiService: a, ctx: ctx, @@ -1045,31 +1127,27 @@ func (a *JobsApiService) GetJobEvaluations(ctx _context.Context, jobName string) } } -/* - * Execute executes the request - * @return []Evaluation - */ -func (a *JobsApiService) GetJobEvaluationsExecute(r ApiGetJobEvaluationsRequest) ([]Evaluation, *_nethttp.Response, error) { +// Execute executes the request +// @return []Evaluation +func (a *JobsApiService) GetJobEvaluationsExecute(r ApiGetJobEvaluationsRequest) ([]Evaluation, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Evaluation ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobEvaluations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/evaluations" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1129,7 +1207,7 @@ func (a *JobsApiService) GetJobEvaluationsExecute(r ApiGetJobEvaluationsRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1139,15 +1217,15 @@ func (a *JobsApiService) GetJobEvaluationsExecute(r ApiGetJobEvaluationsRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1156,7 +1234,7 @@ func (a *JobsApiService) GetJobEvaluationsExecute(r ApiGetJobEvaluationsRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1167,7 +1245,7 @@ func (a *JobsApiService) GetJobEvaluationsExecute(r ApiGetJobEvaluationsRequest) } type ApiGetJobScaleStatusRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -1181,54 +1259,72 @@ type ApiGetJobScaleStatusRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetJobScaleStatusRequest) Region(region string) ApiGetJobScaleStatusRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobScaleStatusRequest) Namespace(namespace string) ApiGetJobScaleStatusRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobScaleStatusRequest) Index(index int32) ApiGetJobScaleStatusRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobScaleStatusRequest) Wait(wait string) ApiGetJobScaleStatusRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobScaleStatusRequest) Stale(stale string) ApiGetJobScaleStatusRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobScaleStatusRequest) Prefix(prefix string) ApiGetJobScaleStatusRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobScaleStatusRequest) XNomadToken(xNomadToken string) ApiGetJobScaleStatusRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobScaleStatusRequest) PerPage(perPage int32) ApiGetJobScaleStatusRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobScaleStatusRequest) NextToken(nextToken string) ApiGetJobScaleStatusRequest { r.nextToken = &nextToken return r } -func (r ApiGetJobScaleStatusRequest) Execute() (JobScaleStatusResponse, *_nethttp.Response, error) { +func (r ApiGetJobScaleStatusRequest) Execute() (*JobScaleStatusResponse, *http.Response, error) { return r.ApiService.GetJobScaleStatusExecute(r) } /* - * GetJobScaleStatus Method for GetJobScaleStatus - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobScaleStatusRequest - */ -func (a *JobsApiService) GetJobScaleStatus(ctx _context.Context, jobName string) ApiGetJobScaleStatusRequest { +GetJobScaleStatus Method for GetJobScaleStatus + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobScaleStatusRequest +*/ +func (a *JobsApiService) GetJobScaleStatus(ctx context.Context, jobName string) ApiGetJobScaleStatusRequest { return ApiGetJobScaleStatusRequest{ ApiService: a, ctx: ctx, @@ -1236,31 +1332,27 @@ func (a *JobsApiService) GetJobScaleStatus(ctx _context.Context, jobName string) } } -/* - * Execute executes the request - * @return JobScaleStatusResponse - */ -func (a *JobsApiService) GetJobScaleStatusExecute(r ApiGetJobScaleStatusRequest) (JobScaleStatusResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobScaleStatusResponse +func (a *JobsApiService) GetJobScaleStatusExecute(r ApiGetJobScaleStatusRequest) (*JobScaleStatusResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobScaleStatusResponse + formFiles []formFile + localVarReturnValue *JobScaleStatusResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobScaleStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/scale" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1320,7 +1412,7 @@ func (a *JobsApiService) GetJobScaleStatusExecute(r ApiGetJobScaleStatusRequest) } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1330,15 +1422,15 @@ func (a *JobsApiService) GetJobScaleStatusExecute(r ApiGetJobScaleStatusRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1347,7 +1439,7 @@ func (a *JobsApiService) GetJobScaleStatusExecute(r ApiGetJobScaleStatusRequest) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1358,7 +1450,7 @@ func (a *JobsApiService) GetJobScaleStatusExecute(r ApiGetJobScaleStatusRequest) } type ApiGetJobSummaryRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -1372,54 +1464,72 @@ type ApiGetJobSummaryRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetJobSummaryRequest) Region(region string) ApiGetJobSummaryRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobSummaryRequest) Namespace(namespace string) ApiGetJobSummaryRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobSummaryRequest) Index(index int32) ApiGetJobSummaryRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobSummaryRequest) Wait(wait string) ApiGetJobSummaryRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobSummaryRequest) Stale(stale string) ApiGetJobSummaryRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobSummaryRequest) Prefix(prefix string) ApiGetJobSummaryRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobSummaryRequest) XNomadToken(xNomadToken string) ApiGetJobSummaryRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobSummaryRequest) PerPage(perPage int32) ApiGetJobSummaryRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobSummaryRequest) NextToken(nextToken string) ApiGetJobSummaryRequest { r.nextToken = &nextToken return r } -func (r ApiGetJobSummaryRequest) Execute() (JobSummary, *_nethttp.Response, error) { +func (r ApiGetJobSummaryRequest) Execute() (*JobSummary, *http.Response, error) { return r.ApiService.GetJobSummaryExecute(r) } /* - * GetJobSummary Method for GetJobSummary - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobSummaryRequest - */ -func (a *JobsApiService) GetJobSummary(ctx _context.Context, jobName string) ApiGetJobSummaryRequest { +GetJobSummary Method for GetJobSummary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobSummaryRequest +*/ +func (a *JobsApiService) GetJobSummary(ctx context.Context, jobName string) ApiGetJobSummaryRequest { return ApiGetJobSummaryRequest{ ApiService: a, ctx: ctx, @@ -1427,31 +1537,27 @@ func (a *JobsApiService) GetJobSummary(ctx _context.Context, jobName string) Api } } -/* - * Execute executes the request - * @return JobSummary - */ -func (a *JobsApiService) GetJobSummaryExecute(r ApiGetJobSummaryRequest) (JobSummary, *_nethttp.Response, error) { +// Execute executes the request +// @return JobSummary +func (a *JobsApiService) GetJobSummaryExecute(r ApiGetJobSummaryRequest) (*JobSummary, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobSummary + formFiles []formFile + localVarReturnValue *JobSummary ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobSummary") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/summary" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1511,7 +1617,7 @@ func (a *JobsApiService) GetJobSummaryExecute(r ApiGetJobSummaryRequest) (JobSum } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1521,15 +1627,15 @@ func (a *JobsApiService) GetJobSummaryExecute(r ApiGetJobSummaryRequest) (JobSum return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1538,7 +1644,7 @@ func (a *JobsApiService) GetJobSummaryExecute(r ApiGetJobSummaryRequest) (JobSum err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1549,7 +1655,7 @@ func (a *JobsApiService) GetJobSummaryExecute(r ApiGetJobSummaryRequest) (JobSum } type ApiGetJobVersionsRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -1564,58 +1670,78 @@ type ApiGetJobVersionsRequest struct { diffs *bool } +// Filters results based on the specified region. func (r ApiGetJobVersionsRequest) Region(region string) ApiGetJobVersionsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobVersionsRequest) Namespace(namespace string) ApiGetJobVersionsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobVersionsRequest) Index(index int32) ApiGetJobVersionsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobVersionsRequest) Wait(wait string) ApiGetJobVersionsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobVersionsRequest) Stale(stale string) ApiGetJobVersionsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobVersionsRequest) Prefix(prefix string) ApiGetJobVersionsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobVersionsRequest) XNomadToken(xNomadToken string) ApiGetJobVersionsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobVersionsRequest) PerPage(perPage int32) ApiGetJobVersionsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobVersionsRequest) NextToken(nextToken string) ApiGetJobVersionsRequest { r.nextToken = &nextToken return r } + +// Boolean flag indicating whether to compute job diffs. func (r ApiGetJobVersionsRequest) Diffs(diffs bool) ApiGetJobVersionsRequest { r.diffs = &diffs return r } -func (r ApiGetJobVersionsRequest) Execute() (JobVersionsResponse, *_nethttp.Response, error) { +func (r ApiGetJobVersionsRequest) Execute() (*JobVersionsResponse, *http.Response, error) { return r.ApiService.GetJobVersionsExecute(r) } /* - * GetJobVersions Method for GetJobVersions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiGetJobVersionsRequest - */ -func (a *JobsApiService) GetJobVersions(ctx _context.Context, jobName string) ApiGetJobVersionsRequest { +GetJobVersions Method for GetJobVersions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiGetJobVersionsRequest +*/ +func (a *JobsApiService) GetJobVersions(ctx context.Context, jobName string) ApiGetJobVersionsRequest { return ApiGetJobVersionsRequest{ ApiService: a, ctx: ctx, @@ -1623,31 +1749,27 @@ func (a *JobsApiService) GetJobVersions(ctx _context.Context, jobName string) Ap } } -/* - * Execute executes the request - * @return JobVersionsResponse - */ -func (a *JobsApiService) GetJobVersionsExecute(r ApiGetJobVersionsRequest) (JobVersionsResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobVersionsResponse +func (a *JobsApiService) GetJobVersionsExecute(r ApiGetJobVersionsRequest) (*JobVersionsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobVersionsResponse + formFiles []formFile + localVarReturnValue *JobVersionsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobVersions") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/versions" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1710,7 +1832,7 @@ func (a *JobsApiService) GetJobVersionsExecute(r ApiGetJobVersionsRequest) (JobV } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1720,15 +1842,15 @@ func (a *JobsApiService) GetJobVersionsExecute(r ApiGetJobVersionsRequest) (JobV return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1737,7 +1859,7 @@ func (a *JobsApiService) GetJobVersionsExecute(r ApiGetJobVersionsRequest) (JobV err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1748,7 +1870,7 @@ func (a *JobsApiService) GetJobVersionsExecute(r ApiGetJobVersionsRequest) (JobV } type ApiGetJobsRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService region *string namespace *string @@ -1761,83 +1883,97 @@ type ApiGetJobsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetJobsRequest) Region(region string) ApiGetJobsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetJobsRequest) Namespace(namespace string) ApiGetJobsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetJobsRequest) Index(index int32) ApiGetJobsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetJobsRequest) Wait(wait string) ApiGetJobsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetJobsRequest) Stale(stale string) ApiGetJobsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetJobsRequest) Prefix(prefix string) ApiGetJobsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetJobsRequest) XNomadToken(xNomadToken string) ApiGetJobsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetJobsRequest) PerPage(perPage int32) ApiGetJobsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetJobsRequest) NextToken(nextToken string) ApiGetJobsRequest { r.nextToken = &nextToken return r } -func (r ApiGetJobsRequest) Execute() ([]JobListStub, *_nethttp.Response, error) { +func (r ApiGetJobsRequest) Execute() ([]JobListStub, *http.Response, error) { return r.ApiService.GetJobsExecute(r) } /* - * GetJobs Method for GetJobs - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetJobsRequest - */ -func (a *JobsApiService) GetJobs(ctx _context.Context) ApiGetJobsRequest { +GetJobs Method for GetJobs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetJobsRequest +*/ +func (a *JobsApiService) GetJobs(ctx context.Context) ApiGetJobsRequest { return ApiGetJobsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []JobListStub - */ -func (a *JobsApiService) GetJobsExecute(r ApiGetJobsRequest) ([]JobListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []JobListStub +func (a *JobsApiService) GetJobsExecute(r ApiGetJobsRequest) ([]JobListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []JobListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.GetJobs") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/jobs" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1897,7 +2033,7 @@ func (a *JobsApiService) GetJobsExecute(r ApiGetJobsRequest) ([]JobListStub, *_n } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1907,15 +2043,15 @@ func (a *JobsApiService) GetJobsExecute(r ApiGetJobsRequest) ([]JobListStub, *_n return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1924,7 +2060,7 @@ func (a *JobsApiService) GetJobsExecute(r ApiGetJobsRequest) ([]JobListStub, *_n err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1935,7 +2071,7 @@ func (a *JobsApiService) GetJobsExecute(r ApiGetJobsRequest) ([]JobListStub, *_n } type ApiPostJobRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string jobRegisterRequest *JobRegisterRequest @@ -1949,34 +2085,43 @@ func (r ApiPostJobRequest) JobRegisterRequest(jobRegisterRequest JobRegisterRequ r.jobRegisterRequest = &jobRegisterRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobRequest) Region(region string) ApiPostJobRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobRequest) Namespace(namespace string) ApiPostJobRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobRequest) XNomadToken(xNomadToken string) ApiPostJobRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobRequest) IdempotencyToken(idempotencyToken string) ApiPostJobRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobRequest) Execute() (JobRegisterResponse, *_nethttp.Response, error) { +func (r ApiPostJobRequest) Execute() (*JobRegisterResponse, *http.Response, error) { return r.ApiService.PostJobExecute(r) } /* - * PostJob Method for PostJob - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobRequest - */ -func (a *JobsApiService) PostJob(ctx _context.Context, jobName string) ApiPostJobRequest { +PostJob Method for PostJob + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobRequest +*/ +func (a *JobsApiService) PostJob(ctx context.Context, jobName string) ApiPostJobRequest { return ApiPostJobRequest{ ApiService: a, ctx: ctx, @@ -1984,31 +2129,27 @@ func (a *JobsApiService) PostJob(ctx _context.Context, jobName string) ApiPostJo } } -/* - * Execute executes the request - * @return JobRegisterResponse - */ -func (a *JobsApiService) PostJobExecute(r ApiPostJobRequest) (JobRegisterResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobRegisterResponse +func (a *JobsApiService) PostJobExecute(r ApiPostJobRequest) (*JobRegisterResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobRegisterResponse + formFiles []formFile + localVarReturnValue *JobRegisterResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJob") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobRegisterRequest == nil { return localVarReturnValue, nil, reportError("jobRegisterRequest is required and must be specified") } @@ -2058,7 +2199,7 @@ func (a *JobsApiService) PostJobExecute(r ApiPostJobRequest) (JobRegisterRespons } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2068,15 +2209,15 @@ func (a *JobsApiService) PostJobExecute(r ApiPostJobRequest) (JobRegisterRespons return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2085,7 +2226,7 @@ func (a *JobsApiService) PostJobExecute(r ApiPostJobRequest) (JobRegisterRespons err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2096,7 +2237,7 @@ func (a *JobsApiService) PostJobExecute(r ApiPostJobRequest) (JobRegisterRespons } type ApiPostJobDispatchRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string jobDispatchRequest *JobDispatchRequest @@ -2110,34 +2251,43 @@ func (r ApiPostJobDispatchRequest) JobDispatchRequest(jobDispatchRequest JobDisp r.jobDispatchRequest = &jobDispatchRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobDispatchRequest) Region(region string) ApiPostJobDispatchRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobDispatchRequest) Namespace(namespace string) ApiPostJobDispatchRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobDispatchRequest) XNomadToken(xNomadToken string) ApiPostJobDispatchRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobDispatchRequest) IdempotencyToken(idempotencyToken string) ApiPostJobDispatchRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobDispatchRequest) Execute() (JobDispatchResponse, *_nethttp.Response, error) { +func (r ApiPostJobDispatchRequest) Execute() (*JobDispatchResponse, *http.Response, error) { return r.ApiService.PostJobDispatchExecute(r) } /* - * PostJobDispatch Method for PostJobDispatch - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobDispatchRequest - */ -func (a *JobsApiService) PostJobDispatch(ctx _context.Context, jobName string) ApiPostJobDispatchRequest { +PostJobDispatch Method for PostJobDispatch + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobDispatchRequest +*/ +func (a *JobsApiService) PostJobDispatch(ctx context.Context, jobName string) ApiPostJobDispatchRequest { return ApiPostJobDispatchRequest{ ApiService: a, ctx: ctx, @@ -2145,31 +2295,27 @@ func (a *JobsApiService) PostJobDispatch(ctx _context.Context, jobName string) A } } -/* - * Execute executes the request - * @return JobDispatchResponse - */ -func (a *JobsApiService) PostJobDispatchExecute(r ApiPostJobDispatchRequest) (JobDispatchResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobDispatchResponse +func (a *JobsApiService) PostJobDispatchExecute(r ApiPostJobDispatchRequest) (*JobDispatchResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobDispatchResponse + formFiles []formFile + localVarReturnValue *JobDispatchResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobDispatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/dispatch" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobDispatchRequest == nil { return localVarReturnValue, nil, reportError("jobDispatchRequest is required and must be specified") } @@ -2219,7 +2365,7 @@ func (a *JobsApiService) PostJobDispatchExecute(r ApiPostJobDispatchRequest) (Jo } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2229,15 +2375,15 @@ func (a *JobsApiService) PostJobDispatchExecute(r ApiPostJobDispatchRequest) (Jo return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2246,7 +2392,7 @@ func (a *JobsApiService) PostJobDispatchExecute(r ApiPostJobDispatchRequest) (Jo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2257,7 +2403,7 @@ func (a *JobsApiService) PostJobDispatchExecute(r ApiPostJobDispatchRequest) (Jo } type ApiPostJobEvaluateRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string jobEvaluateRequest *JobEvaluateRequest @@ -2271,34 +2417,43 @@ func (r ApiPostJobEvaluateRequest) JobEvaluateRequest(jobEvaluateRequest JobEval r.jobEvaluateRequest = &jobEvaluateRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobEvaluateRequest) Region(region string) ApiPostJobEvaluateRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobEvaluateRequest) Namespace(namespace string) ApiPostJobEvaluateRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobEvaluateRequest) XNomadToken(xNomadToken string) ApiPostJobEvaluateRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobEvaluateRequest) IdempotencyToken(idempotencyToken string) ApiPostJobEvaluateRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobEvaluateRequest) Execute() (JobRegisterResponse, *_nethttp.Response, error) { +func (r ApiPostJobEvaluateRequest) Execute() (*JobRegisterResponse, *http.Response, error) { return r.ApiService.PostJobEvaluateExecute(r) } /* - * PostJobEvaluate Method for PostJobEvaluate - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobEvaluateRequest - */ -func (a *JobsApiService) PostJobEvaluate(ctx _context.Context, jobName string) ApiPostJobEvaluateRequest { +PostJobEvaluate Method for PostJobEvaluate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobEvaluateRequest +*/ +func (a *JobsApiService) PostJobEvaluate(ctx context.Context, jobName string) ApiPostJobEvaluateRequest { return ApiPostJobEvaluateRequest{ ApiService: a, ctx: ctx, @@ -2306,31 +2461,27 @@ func (a *JobsApiService) PostJobEvaluate(ctx _context.Context, jobName string) A } } -/* - * Execute executes the request - * @return JobRegisterResponse - */ -func (a *JobsApiService) PostJobEvaluateExecute(r ApiPostJobEvaluateRequest) (JobRegisterResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobRegisterResponse +func (a *JobsApiService) PostJobEvaluateExecute(r ApiPostJobEvaluateRequest) (*JobRegisterResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobRegisterResponse + formFiles []formFile + localVarReturnValue *JobRegisterResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobEvaluate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/evaluate" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobEvaluateRequest == nil { return localVarReturnValue, nil, reportError("jobEvaluateRequest is required and must be specified") } @@ -2380,7 +2531,7 @@ func (a *JobsApiService) PostJobEvaluateExecute(r ApiPostJobEvaluateRequest) (Jo } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2390,15 +2541,15 @@ func (a *JobsApiService) PostJobEvaluateExecute(r ApiPostJobEvaluateRequest) (Jo return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2407,7 +2558,7 @@ func (a *JobsApiService) PostJobEvaluateExecute(r ApiPostJobEvaluateRequest) (Jo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2418,7 +2569,7 @@ func (a *JobsApiService) PostJobEvaluateExecute(r ApiPostJobEvaluateRequest) (Jo } type ApiPostJobParseRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobsParseRequest *JobsParseRequest } @@ -2428,46 +2579,43 @@ func (r ApiPostJobParseRequest) JobsParseRequest(jobsParseRequest JobsParseReque return r } -func (r ApiPostJobParseRequest) Execute() (Job, *_nethttp.Response, error) { +func (r ApiPostJobParseRequest) Execute() (*Job, *http.Response, error) { return r.ApiService.PostJobParseExecute(r) } /* - * PostJobParse Method for PostJobParse - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostJobParseRequest - */ -func (a *JobsApiService) PostJobParse(ctx _context.Context) ApiPostJobParseRequest { +PostJobParse Method for PostJobParse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostJobParseRequest +*/ +func (a *JobsApiService) PostJobParse(ctx context.Context) ApiPostJobParseRequest { return ApiPostJobParseRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return Job - */ -func (a *JobsApiService) PostJobParseExecute(r ApiPostJobParseRequest) (Job, *_nethttp.Response, error) { +// Execute executes the request +// @return Job +func (a *JobsApiService) PostJobParseExecute(r ApiPostJobParseRequest) (*Job, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Job + formFiles []formFile + localVarReturnValue *Job ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobParse") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/jobs/parse" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobsParseRequest == nil { return localVarReturnValue, nil, reportError("jobsParseRequest is required and must be specified") } @@ -2505,7 +2653,7 @@ func (a *JobsApiService) PostJobParseExecute(r ApiPostJobParseRequest) (Job, *_n } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2515,15 +2663,15 @@ func (a *JobsApiService) PostJobParseExecute(r ApiPostJobParseRequest) (Job, *_n return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2532,7 +2680,7 @@ func (a *JobsApiService) PostJobParseExecute(r ApiPostJobParseRequest) (Job, *_n err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2543,7 +2691,7 @@ func (a *JobsApiService) PostJobParseExecute(r ApiPostJobParseRequest) (Job, *_n } type ApiPostJobPeriodicForceRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string region *string @@ -2552,34 +2700,42 @@ type ApiPostJobPeriodicForceRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiPostJobPeriodicForceRequest) Region(region string) ApiPostJobPeriodicForceRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobPeriodicForceRequest) Namespace(namespace string) ApiPostJobPeriodicForceRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobPeriodicForceRequest) XNomadToken(xNomadToken string) ApiPostJobPeriodicForceRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobPeriodicForceRequest) IdempotencyToken(idempotencyToken string) ApiPostJobPeriodicForceRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobPeriodicForceRequest) Execute() (PeriodicForceResponse, *_nethttp.Response, error) { +func (r ApiPostJobPeriodicForceRequest) Execute() (*PeriodicForceResponse, *http.Response, error) { return r.ApiService.PostJobPeriodicForceExecute(r) } /* - * PostJobPeriodicForce Method for PostJobPeriodicForce - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobPeriodicForceRequest - */ -func (a *JobsApiService) PostJobPeriodicForce(ctx _context.Context, jobName string) ApiPostJobPeriodicForceRequest { +PostJobPeriodicForce Method for PostJobPeriodicForce + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobPeriodicForceRequest +*/ +func (a *JobsApiService) PostJobPeriodicForce(ctx context.Context, jobName string) ApiPostJobPeriodicForceRequest { return ApiPostJobPeriodicForceRequest{ ApiService: a, ctx: ctx, @@ -2587,31 +2743,27 @@ func (a *JobsApiService) PostJobPeriodicForce(ctx _context.Context, jobName stri } } -/* - * Execute executes the request - * @return PeriodicForceResponse - */ -func (a *JobsApiService) PostJobPeriodicForceExecute(r ApiPostJobPeriodicForceRequest) (PeriodicForceResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return PeriodicForceResponse +func (a *JobsApiService) PostJobPeriodicForceExecute(r ApiPostJobPeriodicForceRequest) (*PeriodicForceResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PeriodicForceResponse + formFiles []formFile + localVarReturnValue *PeriodicForceResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobPeriodicForce") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/periodic/force" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -2656,7 +2808,7 @@ func (a *JobsApiService) PostJobPeriodicForceExecute(r ApiPostJobPeriodicForceRe } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2666,15 +2818,15 @@ func (a *JobsApiService) PostJobPeriodicForceExecute(r ApiPostJobPeriodicForceRe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2683,7 +2835,7 @@ func (a *JobsApiService) PostJobPeriodicForceExecute(r ApiPostJobPeriodicForceRe err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2694,7 +2846,7 @@ func (a *JobsApiService) PostJobPeriodicForceExecute(r ApiPostJobPeriodicForceRe } type ApiPostJobPlanRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string jobPlanRequest *JobPlanRequest @@ -2708,34 +2860,43 @@ func (r ApiPostJobPlanRequest) JobPlanRequest(jobPlanRequest JobPlanRequest) Api r.jobPlanRequest = &jobPlanRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobPlanRequest) Region(region string) ApiPostJobPlanRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobPlanRequest) Namespace(namespace string) ApiPostJobPlanRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobPlanRequest) XNomadToken(xNomadToken string) ApiPostJobPlanRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobPlanRequest) IdempotencyToken(idempotencyToken string) ApiPostJobPlanRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobPlanRequest) Execute() (JobPlanResponse, *_nethttp.Response, error) { +func (r ApiPostJobPlanRequest) Execute() (*JobPlanResponse, *http.Response, error) { return r.ApiService.PostJobPlanExecute(r) } /* - * PostJobPlan Method for PostJobPlan - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobPlanRequest - */ -func (a *JobsApiService) PostJobPlan(ctx _context.Context, jobName string) ApiPostJobPlanRequest { +PostJobPlan Method for PostJobPlan + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobPlanRequest +*/ +func (a *JobsApiService) PostJobPlan(ctx context.Context, jobName string) ApiPostJobPlanRequest { return ApiPostJobPlanRequest{ ApiService: a, ctx: ctx, @@ -2743,31 +2904,27 @@ func (a *JobsApiService) PostJobPlan(ctx _context.Context, jobName string) ApiPo } } -/* - * Execute executes the request - * @return JobPlanResponse - */ -func (a *JobsApiService) PostJobPlanExecute(r ApiPostJobPlanRequest) (JobPlanResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobPlanResponse +func (a *JobsApiService) PostJobPlanExecute(r ApiPostJobPlanRequest) (*JobPlanResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobPlanResponse + formFiles []formFile + localVarReturnValue *JobPlanResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobPlan") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/plan" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobPlanRequest == nil { return localVarReturnValue, nil, reportError("jobPlanRequest is required and must be specified") } @@ -2817,7 +2974,7 @@ func (a *JobsApiService) PostJobPlanExecute(r ApiPostJobPlanRequest) (JobPlanRes } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2827,15 +2984,15 @@ func (a *JobsApiService) PostJobPlanExecute(r ApiPostJobPlanRequest) (JobPlanRes return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2844,7 +3001,7 @@ func (a *JobsApiService) PostJobPlanExecute(r ApiPostJobPlanRequest) (JobPlanRes err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2855,7 +3012,7 @@ func (a *JobsApiService) PostJobPlanExecute(r ApiPostJobPlanRequest) (JobPlanRes } type ApiPostJobRevertRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string jobRevertRequest *JobRevertRequest @@ -2869,34 +3026,43 @@ func (r ApiPostJobRevertRequest) JobRevertRequest(jobRevertRequest JobRevertRequ r.jobRevertRequest = &jobRevertRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobRevertRequest) Region(region string) ApiPostJobRevertRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobRevertRequest) Namespace(namespace string) ApiPostJobRevertRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobRevertRequest) XNomadToken(xNomadToken string) ApiPostJobRevertRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobRevertRequest) IdempotencyToken(idempotencyToken string) ApiPostJobRevertRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobRevertRequest) Execute() (JobRegisterResponse, *_nethttp.Response, error) { +func (r ApiPostJobRevertRequest) Execute() (*JobRegisterResponse, *http.Response, error) { return r.ApiService.PostJobRevertExecute(r) } /* - * PostJobRevert Method for PostJobRevert - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobRevertRequest - */ -func (a *JobsApiService) PostJobRevert(ctx _context.Context, jobName string) ApiPostJobRevertRequest { +PostJobRevert Method for PostJobRevert + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobRevertRequest +*/ +func (a *JobsApiService) PostJobRevert(ctx context.Context, jobName string) ApiPostJobRevertRequest { return ApiPostJobRevertRequest{ ApiService: a, ctx: ctx, @@ -2904,31 +3070,27 @@ func (a *JobsApiService) PostJobRevert(ctx _context.Context, jobName string) Api } } -/* - * Execute executes the request - * @return JobRegisterResponse - */ -func (a *JobsApiService) PostJobRevertExecute(r ApiPostJobRevertRequest) (JobRegisterResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobRegisterResponse +func (a *JobsApiService) PostJobRevertExecute(r ApiPostJobRevertRequest) (*JobRegisterResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobRegisterResponse + formFiles []formFile + localVarReturnValue *JobRegisterResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobRevert") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/revert" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobRevertRequest == nil { return localVarReturnValue, nil, reportError("jobRevertRequest is required and must be specified") } @@ -2978,7 +3140,7 @@ func (a *JobsApiService) PostJobRevertExecute(r ApiPostJobRevertRequest) (JobReg } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2988,15 +3150,15 @@ func (a *JobsApiService) PostJobRevertExecute(r ApiPostJobRevertRequest) (JobReg return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3005,7 +3167,7 @@ func (a *JobsApiService) PostJobRevertExecute(r ApiPostJobRevertRequest) (JobReg err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -3016,7 +3178,7 @@ func (a *JobsApiService) PostJobRevertExecute(r ApiPostJobRevertRequest) (JobReg } type ApiPostJobScalingRequestRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string scalingRequest *ScalingRequest @@ -3030,34 +3192,43 @@ func (r ApiPostJobScalingRequestRequest) ScalingRequest(scalingRequest ScalingRe r.scalingRequest = &scalingRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobScalingRequestRequest) Region(region string) ApiPostJobScalingRequestRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobScalingRequestRequest) Namespace(namespace string) ApiPostJobScalingRequestRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobScalingRequestRequest) XNomadToken(xNomadToken string) ApiPostJobScalingRequestRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobScalingRequestRequest) IdempotencyToken(idempotencyToken string) ApiPostJobScalingRequestRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobScalingRequestRequest) Execute() (JobRegisterResponse, *_nethttp.Response, error) { +func (r ApiPostJobScalingRequestRequest) Execute() (*JobRegisterResponse, *http.Response, error) { return r.ApiService.PostJobScalingRequestExecute(r) } /* - * PostJobScalingRequest Method for PostJobScalingRequest - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobScalingRequestRequest - */ -func (a *JobsApiService) PostJobScalingRequest(ctx _context.Context, jobName string) ApiPostJobScalingRequestRequest { +PostJobScalingRequest Method for PostJobScalingRequest + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobScalingRequestRequest +*/ +func (a *JobsApiService) PostJobScalingRequest(ctx context.Context, jobName string) ApiPostJobScalingRequestRequest { return ApiPostJobScalingRequestRequest{ ApiService: a, ctx: ctx, @@ -3065,31 +3236,27 @@ func (a *JobsApiService) PostJobScalingRequest(ctx _context.Context, jobName str } } -/* - * Execute executes the request - * @return JobRegisterResponse - */ -func (a *JobsApiService) PostJobScalingRequestExecute(r ApiPostJobScalingRequestRequest) (JobRegisterResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobRegisterResponse +func (a *JobsApiService) PostJobScalingRequestExecute(r ApiPostJobScalingRequestRequest) (*JobRegisterResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobRegisterResponse + formFiles []formFile + localVarReturnValue *JobRegisterResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobScalingRequest") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/scale" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.scalingRequest == nil { return localVarReturnValue, nil, reportError("scalingRequest is required and must be specified") } @@ -3139,7 +3306,7 @@ func (a *JobsApiService) PostJobScalingRequestExecute(r ApiPostJobScalingRequest } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -3149,15 +3316,15 @@ func (a *JobsApiService) PostJobScalingRequestExecute(r ApiPostJobScalingRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3166,7 +3333,7 @@ func (a *JobsApiService) PostJobScalingRequestExecute(r ApiPostJobScalingRequest err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -3177,7 +3344,7 @@ func (a *JobsApiService) PostJobScalingRequestExecute(r ApiPostJobScalingRequest } type ApiPostJobStabilityRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobName string jobStabilityRequest *JobStabilityRequest @@ -3191,34 +3358,43 @@ func (r ApiPostJobStabilityRequest) JobStabilityRequest(jobStabilityRequest JobS r.jobStabilityRequest = &jobStabilityRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobStabilityRequest) Region(region string) ApiPostJobStabilityRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobStabilityRequest) Namespace(namespace string) ApiPostJobStabilityRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobStabilityRequest) XNomadToken(xNomadToken string) ApiPostJobStabilityRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobStabilityRequest) IdempotencyToken(idempotencyToken string) ApiPostJobStabilityRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobStabilityRequest) Execute() (JobStabilityResponse, *_nethttp.Response, error) { +func (r ApiPostJobStabilityRequest) Execute() (*JobStabilityResponse, *http.Response, error) { return r.ApiService.PostJobStabilityExecute(r) } /* - * PostJobStability Method for PostJobStability - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param jobName The job identifier. - * @return ApiPostJobStabilityRequest - */ -func (a *JobsApiService) PostJobStability(ctx _context.Context, jobName string) ApiPostJobStabilityRequest { +PostJobStability Method for PostJobStability + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param jobName The job identifier. + @return ApiPostJobStabilityRequest +*/ +func (a *JobsApiService) PostJobStability(ctx context.Context, jobName string) ApiPostJobStabilityRequest { return ApiPostJobStabilityRequest{ ApiService: a, ctx: ctx, @@ -3226,31 +3402,27 @@ func (a *JobsApiService) PostJobStability(ctx _context.Context, jobName string) } } -/* - * Execute executes the request - * @return JobStabilityResponse - */ -func (a *JobsApiService) PostJobStabilityExecute(r ApiPostJobStabilityRequest) (JobStabilityResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobStabilityResponse +func (a *JobsApiService) PostJobStabilityExecute(r ApiPostJobStabilityRequest) (*JobStabilityResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobStabilityResponse + formFiles []formFile + localVarReturnValue *JobStabilityResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobStability") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/job/{jobName}/stable" - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", _neturl.PathEscape(parameterToString(r.jobName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(parameterToString(r.jobName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobStabilityRequest == nil { return localVarReturnValue, nil, reportError("jobStabilityRequest is required and must be specified") } @@ -3300,7 +3472,7 @@ func (a *JobsApiService) PostJobStabilityExecute(r ApiPostJobStabilityRequest) ( } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -3310,15 +3482,15 @@ func (a *JobsApiService) PostJobStabilityExecute(r ApiPostJobStabilityRequest) ( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3327,7 +3499,7 @@ func (a *JobsApiService) PostJobStabilityExecute(r ApiPostJobStabilityRequest) ( err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -3338,7 +3510,7 @@ func (a *JobsApiService) PostJobStabilityExecute(r ApiPostJobStabilityRequest) ( } type ApiPostJobValidateRequestRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobValidateRequest *JobValidateRequest region *string @@ -3351,63 +3523,68 @@ func (r ApiPostJobValidateRequestRequest) JobValidateRequest(jobValidateRequest r.jobValidateRequest = &jobValidateRequest return r } + +// Filters results based on the specified region. func (r ApiPostJobValidateRequestRequest) Region(region string) ApiPostJobValidateRequestRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostJobValidateRequestRequest) Namespace(namespace string) ApiPostJobValidateRequestRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostJobValidateRequestRequest) XNomadToken(xNomadToken string) ApiPostJobValidateRequestRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostJobValidateRequestRequest) IdempotencyToken(idempotencyToken string) ApiPostJobValidateRequestRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostJobValidateRequestRequest) Execute() (JobValidateResponse, *_nethttp.Response, error) { +func (r ApiPostJobValidateRequestRequest) Execute() (*JobValidateResponse, *http.Response, error) { return r.ApiService.PostJobValidateRequestExecute(r) } /* - * PostJobValidateRequest Method for PostJobValidateRequest - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostJobValidateRequestRequest - */ -func (a *JobsApiService) PostJobValidateRequest(ctx _context.Context) ApiPostJobValidateRequestRequest { +PostJobValidateRequest Method for PostJobValidateRequest + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostJobValidateRequestRequest +*/ +func (a *JobsApiService) PostJobValidateRequest(ctx context.Context) ApiPostJobValidateRequestRequest { return ApiPostJobValidateRequestRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return JobValidateResponse - */ -func (a *JobsApiService) PostJobValidateRequestExecute(r ApiPostJobValidateRequestRequest) (JobValidateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobValidateResponse +func (a *JobsApiService) PostJobValidateRequestExecute(r ApiPostJobValidateRequestRequest) (*JobValidateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobValidateResponse + formFiles []formFile + localVarReturnValue *JobValidateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.PostJobValidateRequest") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/validate/job" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobValidateRequest == nil { return localVarReturnValue, nil, reportError("jobValidateRequest is required and must be specified") } @@ -3457,7 +3634,7 @@ func (a *JobsApiService) PostJobValidateRequestExecute(r ApiPostJobValidateReque } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -3467,15 +3644,15 @@ func (a *JobsApiService) PostJobValidateRequestExecute(r ApiPostJobValidateReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3484,7 +3661,7 @@ func (a *JobsApiService) PostJobValidateRequestExecute(r ApiPostJobValidateReque err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -3495,7 +3672,7 @@ func (a *JobsApiService) PostJobValidateRequestExecute(r ApiPostJobValidateReque } type ApiRegisterJobRequest struct { - ctx _context.Context + ctx context.Context ApiService *JobsApiService jobRegisterRequest *JobRegisterRequest region *string @@ -3508,63 +3685,68 @@ func (r ApiRegisterJobRequest) JobRegisterRequest(jobRegisterRequest JobRegister r.jobRegisterRequest = &jobRegisterRequest return r } + +// Filters results based on the specified region. func (r ApiRegisterJobRequest) Region(region string) ApiRegisterJobRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiRegisterJobRequest) Namespace(namespace string) ApiRegisterJobRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiRegisterJobRequest) XNomadToken(xNomadToken string) ApiRegisterJobRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiRegisterJobRequest) IdempotencyToken(idempotencyToken string) ApiRegisterJobRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiRegisterJobRequest) Execute() (JobRegisterResponse, *_nethttp.Response, error) { +func (r ApiRegisterJobRequest) Execute() (*JobRegisterResponse, *http.Response, error) { return r.ApiService.RegisterJobExecute(r) } /* - * RegisterJob Method for RegisterJob - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiRegisterJobRequest - */ -func (a *JobsApiService) RegisterJob(ctx _context.Context) ApiRegisterJobRequest { +RegisterJob Method for RegisterJob + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRegisterJobRequest +*/ +func (a *JobsApiService) RegisterJob(ctx context.Context) ApiRegisterJobRequest { return ApiRegisterJobRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return JobRegisterResponse - */ -func (a *JobsApiService) RegisterJobExecute(r ApiRegisterJobRequest) (JobRegisterResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return JobRegisterResponse +func (a *JobsApiService) RegisterJobExecute(r ApiRegisterJobRequest) (*JobRegisterResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue JobRegisterResponse + formFiles []formFile + localVarReturnValue *JobRegisterResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JobsApiService.RegisterJob") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/jobs" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.jobRegisterRequest == nil { return localVarReturnValue, nil, reportError("jobRegisterRequest is required and must be specified") } @@ -3614,7 +3796,7 @@ func (a *JobsApiService) RegisterJobExecute(r ApiRegisterJobRequest) (JobRegiste } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -3624,15 +3806,15 @@ func (a *JobsApiService) RegisterJobExecute(r ApiRegisterJobRequest) (JobRegiste return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3641,7 +3823,7 @@ func (a *JobsApiService) RegisterJobExecute(r ApiRegisterJobRequest) (JobRegiste err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_metrics.go b/clients/go/v1/api_metrics.go index 3419b2e5..dc1a95aa 100644 --- a/clients/go/v1/api_metrics.go +++ b/clients/go/v1/api_metrics.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,71 +13,65 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // MetricsApiService MetricsApi service type MetricsApiService service type ApiGetMetricsSummaryRequest struct { - ctx _context.Context + ctx context.Context ApiService *MetricsApiService format *string } +// The format the user requested for the metrics summary (e.g. prometheus) func (r ApiGetMetricsSummaryRequest) Format(format string) ApiGetMetricsSummaryRequest { r.format = &format return r } -func (r ApiGetMetricsSummaryRequest) Execute() (MetricsSummary, *_nethttp.Response, error) { +func (r ApiGetMetricsSummaryRequest) Execute() (*MetricsSummary, *http.Response, error) { return r.ApiService.GetMetricsSummaryExecute(r) } /* - * GetMetricsSummary Method for GetMetricsSummary - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetMetricsSummaryRequest - */ -func (a *MetricsApiService) GetMetricsSummary(ctx _context.Context) ApiGetMetricsSummaryRequest { +GetMetricsSummary Method for GetMetricsSummary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetMetricsSummaryRequest +*/ +func (a *MetricsApiService) GetMetricsSummary(ctx context.Context) ApiGetMetricsSummaryRequest { return ApiGetMetricsSummaryRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return MetricsSummary - */ -func (a *MetricsApiService) GetMetricsSummaryExecute(r ApiGetMetricsSummaryRequest) (MetricsSummary, *_nethttp.Response, error) { +// Execute executes the request +// @return MetricsSummary +func (a *MetricsApiService) GetMetricsSummaryExecute(r ApiGetMetricsSummaryRequest) (*MetricsSummary, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MetricsSummary + formFiles []formFile + localVarReturnValue *MetricsSummary ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetricsApiService.GetMetricsSummary") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/metrics" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.format != nil { localVarQueryParams.Add("format", parameterToString(*r.format, "")) @@ -113,7 +107,7 @@ func (a *MetricsApiService) GetMetricsSummaryExecute(r ApiGetMetricsSummaryReque } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -123,15 +117,15 @@ func (a *MetricsApiService) GetMetricsSummaryExecute(r ApiGetMetricsSummaryReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -140,7 +134,7 @@ func (a *MetricsApiService) GetMetricsSummaryExecute(r ApiGetMetricsSummaryReque err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_namespaces.go b/clients/go/v1/api_namespaces.go index 82d27829..02e75f74 100644 --- a/clients/go/v1/api_namespaces.go +++ b/clients/go/v1/api_namespaces.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // NamespacesApiService NamespacesApi service type NamespacesApiService service type ApiCreateNamespaceRequest struct { - ctx _context.Context + ctx context.Context ApiService *NamespacesApiService region *string namespace *string @@ -37,61 +33,65 @@ type ApiCreateNamespaceRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiCreateNamespaceRequest) Region(region string) ApiCreateNamespaceRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiCreateNamespaceRequest) Namespace(namespace string) ApiCreateNamespaceRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiCreateNamespaceRequest) XNomadToken(xNomadToken string) ApiCreateNamespaceRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiCreateNamespaceRequest) IdempotencyToken(idempotencyToken string) ApiCreateNamespaceRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiCreateNamespaceRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateNamespaceRequest) Execute() (*http.Response, error) { return r.ApiService.CreateNamespaceExecute(r) } /* - * CreateNamespace Method for CreateNamespace - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateNamespaceRequest - */ -func (a *NamespacesApiService) CreateNamespace(ctx _context.Context) ApiCreateNamespaceRequest { +CreateNamespace Method for CreateNamespace + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateNamespaceRequest +*/ +func (a *NamespacesApiService) CreateNamespace(ctx context.Context) ApiCreateNamespaceRequest { return ApiCreateNamespaceRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *NamespacesApiService) CreateNamespaceExecute(r ApiCreateNamespaceRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *NamespacesApiService) CreateNamespaceExecute(r ApiCreateNamespaceRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NamespacesApiService.CreateNamespace") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/namespace" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -136,7 +136,7 @@ func (a *NamespacesApiService) CreateNamespaceExecute(r ApiCreateNamespaceReques } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -146,15 +146,15 @@ func (a *NamespacesApiService) CreateNamespaceExecute(r ApiCreateNamespaceReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -165,7 +165,7 @@ func (a *NamespacesApiService) CreateNamespaceExecute(r ApiCreateNamespaceReques } type ApiDeleteNamespaceRequest struct { - ctx _context.Context + ctx context.Context ApiService *NamespacesApiService namespaceName string region *string @@ -174,34 +174,42 @@ type ApiDeleteNamespaceRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiDeleteNamespaceRequest) Region(region string) ApiDeleteNamespaceRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteNamespaceRequest) Namespace(namespace string) ApiDeleteNamespaceRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteNamespaceRequest) XNomadToken(xNomadToken string) ApiDeleteNamespaceRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteNamespaceRequest) IdempotencyToken(idempotencyToken string) ApiDeleteNamespaceRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiDeleteNamespaceRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteNamespaceRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteNamespaceExecute(r) } /* - * DeleteNamespace Method for DeleteNamespace - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param namespaceName The namespace identifier. - * @return ApiDeleteNamespaceRequest - */ -func (a *NamespacesApiService) DeleteNamespace(ctx _context.Context, namespaceName string) ApiDeleteNamespaceRequest { +DeleteNamespace Method for DeleteNamespace + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespaceName The namespace identifier. + @return ApiDeleteNamespaceRequest +*/ +func (a *NamespacesApiService) DeleteNamespace(ctx context.Context, namespaceName string) ApiDeleteNamespaceRequest { return ApiDeleteNamespaceRequest{ ApiService: a, ctx: ctx, @@ -209,29 +217,25 @@ func (a *NamespacesApiService) DeleteNamespace(ctx _context.Context, namespaceNa } } -/* - * Execute executes the request - */ -func (a *NamespacesApiService) DeleteNamespaceExecute(r ApiDeleteNamespaceRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *NamespacesApiService) DeleteNamespaceExecute(r ApiDeleteNamespaceRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NamespacesApiService.DeleteNamespace") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/namespace/{namespaceName}" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceName"+"}", _neturl.PathEscape(parameterToString(r.namespaceName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceName"+"}", url.PathEscape(parameterToString(r.namespaceName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -276,7 +280,7 @@ func (a *NamespacesApiService) DeleteNamespaceExecute(r ApiDeleteNamespaceReques } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -286,15 +290,15 @@ func (a *NamespacesApiService) DeleteNamespaceExecute(r ApiDeleteNamespaceReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -305,7 +309,7 @@ func (a *NamespacesApiService) DeleteNamespaceExecute(r ApiDeleteNamespaceReques } type ApiGetNamespaceRequest struct { - ctx _context.Context + ctx context.Context ApiService *NamespacesApiService namespaceName string region *string @@ -319,54 +323,72 @@ type ApiGetNamespaceRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetNamespaceRequest) Region(region string) ApiGetNamespaceRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetNamespaceRequest) Namespace(namespace string) ApiGetNamespaceRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetNamespaceRequest) Index(index int32) ApiGetNamespaceRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetNamespaceRequest) Wait(wait string) ApiGetNamespaceRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetNamespaceRequest) Stale(stale string) ApiGetNamespaceRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetNamespaceRequest) Prefix(prefix string) ApiGetNamespaceRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetNamespaceRequest) XNomadToken(xNomadToken string) ApiGetNamespaceRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetNamespaceRequest) PerPage(perPage int32) ApiGetNamespaceRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetNamespaceRequest) NextToken(nextToken string) ApiGetNamespaceRequest { r.nextToken = &nextToken return r } -func (r ApiGetNamespaceRequest) Execute() (Namespace, *_nethttp.Response, error) { +func (r ApiGetNamespaceRequest) Execute() (*Namespace, *http.Response, error) { return r.ApiService.GetNamespaceExecute(r) } /* - * GetNamespace Method for GetNamespace - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param namespaceName The namespace identifier. - * @return ApiGetNamespaceRequest - */ -func (a *NamespacesApiService) GetNamespace(ctx _context.Context, namespaceName string) ApiGetNamespaceRequest { +GetNamespace Method for GetNamespace + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespaceName The namespace identifier. + @return ApiGetNamespaceRequest +*/ +func (a *NamespacesApiService) GetNamespace(ctx context.Context, namespaceName string) ApiGetNamespaceRequest { return ApiGetNamespaceRequest{ ApiService: a, ctx: ctx, @@ -374,31 +396,27 @@ func (a *NamespacesApiService) GetNamespace(ctx _context.Context, namespaceName } } -/* - * Execute executes the request - * @return Namespace - */ -func (a *NamespacesApiService) GetNamespaceExecute(r ApiGetNamespaceRequest) (Namespace, *_nethttp.Response, error) { +// Execute executes the request +// @return Namespace +func (a *NamespacesApiService) GetNamespaceExecute(r ApiGetNamespaceRequest) (*Namespace, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Namespace + formFiles []formFile + localVarReturnValue *Namespace ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NamespacesApiService.GetNamespace") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/namespace/{namespaceName}" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceName"+"}", _neturl.PathEscape(parameterToString(r.namespaceName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceName"+"}", url.PathEscape(parameterToString(r.namespaceName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -458,7 +476,7 @@ func (a *NamespacesApiService) GetNamespaceExecute(r ApiGetNamespaceRequest) (Na } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -468,15 +486,15 @@ func (a *NamespacesApiService) GetNamespaceExecute(r ApiGetNamespaceRequest) (Na return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -485,7 +503,7 @@ func (a *NamespacesApiService) GetNamespaceExecute(r ApiGetNamespaceRequest) (Na err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -496,7 +514,7 @@ func (a *NamespacesApiService) GetNamespaceExecute(r ApiGetNamespaceRequest) (Na } type ApiGetNamespacesRequest struct { - ctx _context.Context + ctx context.Context ApiService *NamespacesApiService region *string namespace *string @@ -509,83 +527,97 @@ type ApiGetNamespacesRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetNamespacesRequest) Region(region string) ApiGetNamespacesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetNamespacesRequest) Namespace(namespace string) ApiGetNamespacesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetNamespacesRequest) Index(index int32) ApiGetNamespacesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetNamespacesRequest) Wait(wait string) ApiGetNamespacesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetNamespacesRequest) Stale(stale string) ApiGetNamespacesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetNamespacesRequest) Prefix(prefix string) ApiGetNamespacesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetNamespacesRequest) XNomadToken(xNomadToken string) ApiGetNamespacesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetNamespacesRequest) PerPage(perPage int32) ApiGetNamespacesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetNamespacesRequest) NextToken(nextToken string) ApiGetNamespacesRequest { r.nextToken = &nextToken return r } -func (r ApiGetNamespacesRequest) Execute() ([]Namespace, *_nethttp.Response, error) { +func (r ApiGetNamespacesRequest) Execute() ([]Namespace, *http.Response, error) { return r.ApiService.GetNamespacesExecute(r) } /* - * GetNamespaces Method for GetNamespaces - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetNamespacesRequest - */ -func (a *NamespacesApiService) GetNamespaces(ctx _context.Context) ApiGetNamespacesRequest { +GetNamespaces Method for GetNamespaces + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetNamespacesRequest +*/ +func (a *NamespacesApiService) GetNamespaces(ctx context.Context) ApiGetNamespacesRequest { return ApiGetNamespacesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []Namespace - */ -func (a *NamespacesApiService) GetNamespacesExecute(r ApiGetNamespacesRequest) ([]Namespace, *_nethttp.Response, error) { +// Execute executes the request +// @return []Namespace +func (a *NamespacesApiService) GetNamespacesExecute(r ApiGetNamespacesRequest) ([]Namespace, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Namespace ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NamespacesApiService.GetNamespaces") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/namespaces" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -645,7 +677,7 @@ func (a *NamespacesApiService) GetNamespacesExecute(r ApiGetNamespacesRequest) ( } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -655,15 +687,15 @@ func (a *NamespacesApiService) GetNamespacesExecute(r ApiGetNamespacesRequest) ( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -672,7 +704,7 @@ func (a *NamespacesApiService) GetNamespacesExecute(r ApiGetNamespacesRequest) ( err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -683,7 +715,7 @@ func (a *NamespacesApiService) GetNamespacesExecute(r ApiGetNamespacesRequest) ( } type ApiPostNamespaceRequest struct { - ctx _context.Context + ctx context.Context ApiService *NamespacesApiService namespaceName string namespace2 *Namespace @@ -697,34 +729,43 @@ func (r ApiPostNamespaceRequest) Namespace2(namespace2 Namespace) ApiPostNamespa r.namespace2 = &namespace2 return r } + +// Filters results based on the specified region. func (r ApiPostNamespaceRequest) Region(region string) ApiPostNamespaceRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostNamespaceRequest) Namespace(namespace string) ApiPostNamespaceRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostNamespaceRequest) XNomadToken(xNomadToken string) ApiPostNamespaceRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostNamespaceRequest) IdempotencyToken(idempotencyToken string) ApiPostNamespaceRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostNamespaceRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPostNamespaceRequest) Execute() (*http.Response, error) { return r.ApiService.PostNamespaceExecute(r) } /* - * PostNamespace Method for PostNamespace - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param namespaceName The namespace identifier. - * @return ApiPostNamespaceRequest - */ -func (a *NamespacesApiService) PostNamespace(ctx _context.Context, namespaceName string) ApiPostNamespaceRequest { +PostNamespace Method for PostNamespace + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespaceName The namespace identifier. + @return ApiPostNamespaceRequest +*/ +func (a *NamespacesApiService) PostNamespace(ctx context.Context, namespaceName string) ApiPostNamespaceRequest { return ApiPostNamespaceRequest{ ApiService: a, ctx: ctx, @@ -732,29 +773,25 @@ func (a *NamespacesApiService) PostNamespace(ctx _context.Context, namespaceName } } -/* - * Execute executes the request - */ -func (a *NamespacesApiService) PostNamespaceExecute(r ApiPostNamespaceRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *NamespacesApiService) PostNamespaceExecute(r ApiPostNamespaceRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NamespacesApiService.PostNamespace") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/namespace/{namespaceName}" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceName"+"}", _neturl.PathEscape(parameterToString(r.namespaceName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceName"+"}", url.PathEscape(parameterToString(r.namespaceName, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.namespace2 == nil { return nil, reportError("namespace2 is required and must be specified") } @@ -804,7 +841,7 @@ func (a *NamespacesApiService) PostNamespaceExecute(r ApiPostNamespaceRequest) ( } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -814,15 +851,15 @@ func (a *NamespacesApiService) PostNamespaceExecute(r ApiPostNamespaceRequest) ( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/clients/go/v1/api_nodes.go b/clients/go/v1/api_nodes.go index baf29761..e0a2f7cb 100644 --- a/clients/go/v1/api_nodes.go +++ b/clients/go/v1/api_nodes.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // NodesApiService NodesApi service type NodesApiService service type ApiGetNodeRequest struct { - ctx _context.Context + ctx context.Context ApiService *NodesApiService nodeId string region *string @@ -43,54 +39,72 @@ type ApiGetNodeRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetNodeRequest) Region(region string) ApiGetNodeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetNodeRequest) Namespace(namespace string) ApiGetNodeRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetNodeRequest) Index(index int32) ApiGetNodeRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetNodeRequest) Wait(wait string) ApiGetNodeRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetNodeRequest) Stale(stale string) ApiGetNodeRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetNodeRequest) Prefix(prefix string) ApiGetNodeRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetNodeRequest) XNomadToken(xNomadToken string) ApiGetNodeRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetNodeRequest) PerPage(perPage int32) ApiGetNodeRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetNodeRequest) NextToken(nextToken string) ApiGetNodeRequest { r.nextToken = &nextToken return r } -func (r ApiGetNodeRequest) Execute() (Node, *_nethttp.Response, error) { +func (r ApiGetNodeRequest) Execute() (*Node, *http.Response, error) { return r.ApiService.GetNodeExecute(r) } /* - * GetNode Method for GetNode - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param nodeId The ID of the node. - * @return ApiGetNodeRequest - */ -func (a *NodesApiService) GetNode(ctx _context.Context, nodeId string) ApiGetNodeRequest { +GetNode Method for GetNode + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param nodeId The ID of the node. + @return ApiGetNodeRequest +*/ +func (a *NodesApiService) GetNode(ctx context.Context, nodeId string) ApiGetNodeRequest { return ApiGetNodeRequest{ ApiService: a, ctx: ctx, @@ -98,31 +112,27 @@ func (a *NodesApiService) GetNode(ctx _context.Context, nodeId string) ApiGetNod } } -/* - * Execute executes the request - * @return Node - */ -func (a *NodesApiService) GetNodeExecute(r ApiGetNodeRequest) (Node, *_nethttp.Response, error) { +// Execute executes the request +// @return Node +func (a *NodesApiService) GetNodeExecute(r ApiGetNodeRequest) (*Node, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Node + formFiles []formFile + localVarReturnValue *Node ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.GetNode") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/node/{nodeId}" - localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", _neturl.PathEscape(parameterToString(r.nodeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", url.PathEscape(parameterToString(r.nodeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -182,7 +192,7 @@ func (a *NodesApiService) GetNodeExecute(r ApiGetNodeRequest) (Node, *_nethttp.R } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -192,15 +202,15 @@ func (a *NodesApiService) GetNodeExecute(r ApiGetNodeRequest) (Node, *_nethttp.R return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -209,7 +219,7 @@ func (a *NodesApiService) GetNodeExecute(r ApiGetNodeRequest) (Node, *_nethttp.R err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -220,7 +230,7 @@ func (a *NodesApiService) GetNodeExecute(r ApiGetNodeRequest) (Node, *_nethttp.R } type ApiGetNodeAllocationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *NodesApiService nodeId string region *string @@ -234,54 +244,72 @@ type ApiGetNodeAllocationsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetNodeAllocationsRequest) Region(region string) ApiGetNodeAllocationsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetNodeAllocationsRequest) Namespace(namespace string) ApiGetNodeAllocationsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetNodeAllocationsRequest) Index(index int32) ApiGetNodeAllocationsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetNodeAllocationsRequest) Wait(wait string) ApiGetNodeAllocationsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetNodeAllocationsRequest) Stale(stale string) ApiGetNodeAllocationsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetNodeAllocationsRequest) Prefix(prefix string) ApiGetNodeAllocationsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetNodeAllocationsRequest) XNomadToken(xNomadToken string) ApiGetNodeAllocationsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetNodeAllocationsRequest) PerPage(perPage int32) ApiGetNodeAllocationsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetNodeAllocationsRequest) NextToken(nextToken string) ApiGetNodeAllocationsRequest { r.nextToken = &nextToken return r } -func (r ApiGetNodeAllocationsRequest) Execute() ([]AllocationListStub, *_nethttp.Response, error) { +func (r ApiGetNodeAllocationsRequest) Execute() ([]AllocationListStub, *http.Response, error) { return r.ApiService.GetNodeAllocationsExecute(r) } /* - * GetNodeAllocations Method for GetNodeAllocations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param nodeId The ID of the node. - * @return ApiGetNodeAllocationsRequest - */ -func (a *NodesApiService) GetNodeAllocations(ctx _context.Context, nodeId string) ApiGetNodeAllocationsRequest { +GetNodeAllocations Method for GetNodeAllocations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param nodeId The ID of the node. + @return ApiGetNodeAllocationsRequest +*/ +func (a *NodesApiService) GetNodeAllocations(ctx context.Context, nodeId string) ApiGetNodeAllocationsRequest { return ApiGetNodeAllocationsRequest{ ApiService: a, ctx: ctx, @@ -289,31 +317,27 @@ func (a *NodesApiService) GetNodeAllocations(ctx _context.Context, nodeId string } } -/* - * Execute executes the request - * @return []AllocationListStub - */ -func (a *NodesApiService) GetNodeAllocationsExecute(r ApiGetNodeAllocationsRequest) ([]AllocationListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []AllocationListStub +func (a *NodesApiService) GetNodeAllocationsExecute(r ApiGetNodeAllocationsRequest) ([]AllocationListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AllocationListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.GetNodeAllocations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/node/{nodeId}/allocations" - localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", _neturl.PathEscape(parameterToString(r.nodeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", url.PathEscape(parameterToString(r.nodeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -373,7 +397,7 @@ func (a *NodesApiService) GetNodeAllocationsExecute(r ApiGetNodeAllocationsReque } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -383,15 +407,15 @@ func (a *NodesApiService) GetNodeAllocationsExecute(r ApiGetNodeAllocationsReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -400,7 +424,7 @@ func (a *NodesApiService) GetNodeAllocationsExecute(r ApiGetNodeAllocationsReque err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -411,7 +435,7 @@ func (a *NodesApiService) GetNodeAllocationsExecute(r ApiGetNodeAllocationsReque } type ApiGetNodesRequest struct { - ctx _context.Context + ctx context.Context ApiService *NodesApiService region *string namespace *string @@ -425,87 +449,103 @@ type ApiGetNodesRequest struct { resources *bool } +// Filters results based on the specified region. func (r ApiGetNodesRequest) Region(region string) ApiGetNodesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetNodesRequest) Namespace(namespace string) ApiGetNodesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetNodesRequest) Index(index int32) ApiGetNodesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetNodesRequest) Wait(wait string) ApiGetNodesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetNodesRequest) Stale(stale string) ApiGetNodesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetNodesRequest) Prefix(prefix string) ApiGetNodesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetNodesRequest) XNomadToken(xNomadToken string) ApiGetNodesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetNodesRequest) PerPage(perPage int32) ApiGetNodesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetNodesRequest) NextToken(nextToken string) ApiGetNodesRequest { r.nextToken = &nextToken return r } + +// Whether or not to include the NodeResources and ReservedResources fields in the response. func (r ApiGetNodesRequest) Resources(resources bool) ApiGetNodesRequest { r.resources = &resources return r } -func (r ApiGetNodesRequest) Execute() ([]NodeListStub, *_nethttp.Response, error) { +func (r ApiGetNodesRequest) Execute() ([]NodeListStub, *http.Response, error) { return r.ApiService.GetNodesExecute(r) } /* - * GetNodes Method for GetNodes - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetNodesRequest - */ -func (a *NodesApiService) GetNodes(ctx _context.Context) ApiGetNodesRequest { +GetNodes Method for GetNodes + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetNodesRequest +*/ +func (a *NodesApiService) GetNodes(ctx context.Context) ApiGetNodesRequest { return ApiGetNodesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []NodeListStub - */ -func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) ([]NodeListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []NodeListStub +func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) ([]NodeListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []NodeListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.GetNodes") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/nodes" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -568,7 +608,7 @@ func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) ([]NodeListStub, } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -578,15 +618,15 @@ func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) ([]NodeListStub, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -595,7 +635,7 @@ func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) ([]NodeListStub, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -606,7 +646,7 @@ func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) ([]NodeListStub, } type ApiUpdateNodeDrainRequest struct { - ctx _context.Context + ctx context.Context ApiService *NodesApiService nodeId string nodeUpdateDrainRequest *NodeUpdateDrainRequest @@ -625,54 +665,73 @@ func (r ApiUpdateNodeDrainRequest) NodeUpdateDrainRequest(nodeUpdateDrainRequest r.nodeUpdateDrainRequest = &nodeUpdateDrainRequest return r } + +// Filters results based on the specified region. func (r ApiUpdateNodeDrainRequest) Region(region string) ApiUpdateNodeDrainRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiUpdateNodeDrainRequest) Namespace(namespace string) ApiUpdateNodeDrainRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiUpdateNodeDrainRequest) Index(index int32) ApiUpdateNodeDrainRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiUpdateNodeDrainRequest) Wait(wait string) ApiUpdateNodeDrainRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiUpdateNodeDrainRequest) Stale(stale string) ApiUpdateNodeDrainRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiUpdateNodeDrainRequest) Prefix(prefix string) ApiUpdateNodeDrainRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiUpdateNodeDrainRequest) XNomadToken(xNomadToken string) ApiUpdateNodeDrainRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiUpdateNodeDrainRequest) PerPage(perPage int32) ApiUpdateNodeDrainRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiUpdateNodeDrainRequest) NextToken(nextToken string) ApiUpdateNodeDrainRequest { r.nextToken = &nextToken return r } -func (r ApiUpdateNodeDrainRequest) Execute() (NodeDrainUpdateResponse, *_nethttp.Response, error) { +func (r ApiUpdateNodeDrainRequest) Execute() (*NodeDrainUpdateResponse, *http.Response, error) { return r.ApiService.UpdateNodeDrainExecute(r) } /* - * UpdateNodeDrain Method for UpdateNodeDrain - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param nodeId The ID of the node. - * @return ApiUpdateNodeDrainRequest - */ -func (a *NodesApiService) UpdateNodeDrain(ctx _context.Context, nodeId string) ApiUpdateNodeDrainRequest { +UpdateNodeDrain Method for UpdateNodeDrain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param nodeId The ID of the node. + @return ApiUpdateNodeDrainRequest +*/ +func (a *NodesApiService) UpdateNodeDrain(ctx context.Context, nodeId string) ApiUpdateNodeDrainRequest { return ApiUpdateNodeDrainRequest{ ApiService: a, ctx: ctx, @@ -680,31 +739,27 @@ func (a *NodesApiService) UpdateNodeDrain(ctx _context.Context, nodeId string) A } } -/* - * Execute executes the request - * @return NodeDrainUpdateResponse - */ -func (a *NodesApiService) UpdateNodeDrainExecute(r ApiUpdateNodeDrainRequest) (NodeDrainUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return NodeDrainUpdateResponse +func (a *NodesApiService) UpdateNodeDrainExecute(r ApiUpdateNodeDrainRequest) (*NodeDrainUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue NodeDrainUpdateResponse + formFiles []formFile + localVarReturnValue *NodeDrainUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.UpdateNodeDrain") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/node/{nodeId}/drain" - localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", _neturl.PathEscape(parameterToString(r.nodeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", url.PathEscape(parameterToString(r.nodeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.nodeUpdateDrainRequest == nil { return localVarReturnValue, nil, reportError("nodeUpdateDrainRequest is required and must be specified") } @@ -769,7 +824,7 @@ func (a *NodesApiService) UpdateNodeDrainExecute(r ApiUpdateNodeDrainRequest) (N } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -779,15 +834,15 @@ func (a *NodesApiService) UpdateNodeDrainExecute(r ApiUpdateNodeDrainRequest) (N return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -796,7 +851,7 @@ func (a *NodesApiService) UpdateNodeDrainExecute(r ApiUpdateNodeDrainRequest) (N err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -807,7 +862,7 @@ func (a *NodesApiService) UpdateNodeDrainExecute(r ApiUpdateNodeDrainRequest) (N } type ApiUpdateNodeEligibilityRequest struct { - ctx _context.Context + ctx context.Context ApiService *NodesApiService nodeId string nodeUpdateEligibilityRequest *NodeUpdateEligibilityRequest @@ -826,54 +881,73 @@ func (r ApiUpdateNodeEligibilityRequest) NodeUpdateEligibilityRequest(nodeUpdate r.nodeUpdateEligibilityRequest = &nodeUpdateEligibilityRequest return r } + +// Filters results based on the specified region. func (r ApiUpdateNodeEligibilityRequest) Region(region string) ApiUpdateNodeEligibilityRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiUpdateNodeEligibilityRequest) Namespace(namespace string) ApiUpdateNodeEligibilityRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiUpdateNodeEligibilityRequest) Index(index int32) ApiUpdateNodeEligibilityRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiUpdateNodeEligibilityRequest) Wait(wait string) ApiUpdateNodeEligibilityRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiUpdateNodeEligibilityRequest) Stale(stale string) ApiUpdateNodeEligibilityRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiUpdateNodeEligibilityRequest) Prefix(prefix string) ApiUpdateNodeEligibilityRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiUpdateNodeEligibilityRequest) XNomadToken(xNomadToken string) ApiUpdateNodeEligibilityRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiUpdateNodeEligibilityRequest) PerPage(perPage int32) ApiUpdateNodeEligibilityRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiUpdateNodeEligibilityRequest) NextToken(nextToken string) ApiUpdateNodeEligibilityRequest { r.nextToken = &nextToken return r } -func (r ApiUpdateNodeEligibilityRequest) Execute() (NodeEligibilityUpdateResponse, *_nethttp.Response, error) { +func (r ApiUpdateNodeEligibilityRequest) Execute() (*NodeEligibilityUpdateResponse, *http.Response, error) { return r.ApiService.UpdateNodeEligibilityExecute(r) } /* - * UpdateNodeEligibility Method for UpdateNodeEligibility - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param nodeId The ID of the node. - * @return ApiUpdateNodeEligibilityRequest - */ -func (a *NodesApiService) UpdateNodeEligibility(ctx _context.Context, nodeId string) ApiUpdateNodeEligibilityRequest { +UpdateNodeEligibility Method for UpdateNodeEligibility + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param nodeId The ID of the node. + @return ApiUpdateNodeEligibilityRequest +*/ +func (a *NodesApiService) UpdateNodeEligibility(ctx context.Context, nodeId string) ApiUpdateNodeEligibilityRequest { return ApiUpdateNodeEligibilityRequest{ ApiService: a, ctx: ctx, @@ -881,31 +955,27 @@ func (a *NodesApiService) UpdateNodeEligibility(ctx _context.Context, nodeId str } } -/* - * Execute executes the request - * @return NodeEligibilityUpdateResponse - */ -func (a *NodesApiService) UpdateNodeEligibilityExecute(r ApiUpdateNodeEligibilityRequest) (NodeEligibilityUpdateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return NodeEligibilityUpdateResponse +func (a *NodesApiService) UpdateNodeEligibilityExecute(r ApiUpdateNodeEligibilityRequest) (*NodeEligibilityUpdateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue NodeEligibilityUpdateResponse + formFiles []formFile + localVarReturnValue *NodeEligibilityUpdateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.UpdateNodeEligibility") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/node/{nodeId}/eligibility" - localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", _neturl.PathEscape(parameterToString(r.nodeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", url.PathEscape(parameterToString(r.nodeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.nodeUpdateEligibilityRequest == nil { return localVarReturnValue, nil, reportError("nodeUpdateEligibilityRequest is required and must be specified") } @@ -970,7 +1040,7 @@ func (a *NodesApiService) UpdateNodeEligibilityExecute(r ApiUpdateNodeEligibilit } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -980,15 +1050,15 @@ func (a *NodesApiService) UpdateNodeEligibilityExecute(r ApiUpdateNodeEligibilit return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -997,7 +1067,7 @@ func (a *NodesApiService) UpdateNodeEligibilityExecute(r ApiUpdateNodeEligibilit err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1008,7 +1078,7 @@ func (a *NodesApiService) UpdateNodeEligibilityExecute(r ApiUpdateNodeEligibilit } type ApiUpdateNodePurgeRequest struct { - ctx _context.Context + ctx context.Context ApiService *NodesApiService nodeId string region *string @@ -1022,54 +1092,72 @@ type ApiUpdateNodePurgeRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiUpdateNodePurgeRequest) Region(region string) ApiUpdateNodePurgeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiUpdateNodePurgeRequest) Namespace(namespace string) ApiUpdateNodePurgeRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiUpdateNodePurgeRequest) Index(index int32) ApiUpdateNodePurgeRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiUpdateNodePurgeRequest) Wait(wait string) ApiUpdateNodePurgeRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiUpdateNodePurgeRequest) Stale(stale string) ApiUpdateNodePurgeRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiUpdateNodePurgeRequest) Prefix(prefix string) ApiUpdateNodePurgeRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiUpdateNodePurgeRequest) XNomadToken(xNomadToken string) ApiUpdateNodePurgeRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiUpdateNodePurgeRequest) PerPage(perPage int32) ApiUpdateNodePurgeRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiUpdateNodePurgeRequest) NextToken(nextToken string) ApiUpdateNodePurgeRequest { r.nextToken = &nextToken return r } -func (r ApiUpdateNodePurgeRequest) Execute() (NodePurgeResponse, *_nethttp.Response, error) { +func (r ApiUpdateNodePurgeRequest) Execute() (*NodePurgeResponse, *http.Response, error) { return r.ApiService.UpdateNodePurgeExecute(r) } /* - * UpdateNodePurge Method for UpdateNodePurge - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param nodeId The ID of the node. - * @return ApiUpdateNodePurgeRequest - */ -func (a *NodesApiService) UpdateNodePurge(ctx _context.Context, nodeId string) ApiUpdateNodePurgeRequest { +UpdateNodePurge Method for UpdateNodePurge + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param nodeId The ID of the node. + @return ApiUpdateNodePurgeRequest +*/ +func (a *NodesApiService) UpdateNodePurge(ctx context.Context, nodeId string) ApiUpdateNodePurgeRequest { return ApiUpdateNodePurgeRequest{ ApiService: a, ctx: ctx, @@ -1077,31 +1165,27 @@ func (a *NodesApiService) UpdateNodePurge(ctx _context.Context, nodeId string) A } } -/* - * Execute executes the request - * @return NodePurgeResponse - */ -func (a *NodesApiService) UpdateNodePurgeExecute(r ApiUpdateNodePurgeRequest) (NodePurgeResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return NodePurgeResponse +func (a *NodesApiService) UpdateNodePurgeExecute(r ApiUpdateNodePurgeRequest) (*NodePurgeResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue NodePurgeResponse + formFiles []formFile + localVarReturnValue *NodePurgeResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.UpdateNodePurge") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/node/{nodeId}/purge" - localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", _neturl.PathEscape(parameterToString(r.nodeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nodeId"+"}", url.PathEscape(parameterToString(r.nodeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1161,7 +1245,7 @@ func (a *NodesApiService) UpdateNodePurgeExecute(r ApiUpdateNodePurgeRequest) (N } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1171,15 +1255,15 @@ func (a *NodesApiService) UpdateNodePurgeExecute(r ApiUpdateNodePurgeRequest) (N return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1188,7 +1272,7 @@ func (a *NodesApiService) UpdateNodePurgeExecute(r ApiUpdateNodePurgeRequest) (N err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_operator.go b/clients/go/v1/api_operator.go index a533175c..0fac9300 100644 --- a/clients/go/v1/api_operator.go +++ b/clients/go/v1/api_operator.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,22 +13,18 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // OperatorApiService OperatorApi service type OperatorApiService service type ApiDeleteOperatorRaftPeerRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService region *string namespace *string @@ -36,61 +32,65 @@ type ApiDeleteOperatorRaftPeerRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiDeleteOperatorRaftPeerRequest) Region(region string) ApiDeleteOperatorRaftPeerRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteOperatorRaftPeerRequest) Namespace(namespace string) ApiDeleteOperatorRaftPeerRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteOperatorRaftPeerRequest) XNomadToken(xNomadToken string) ApiDeleteOperatorRaftPeerRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteOperatorRaftPeerRequest) IdempotencyToken(idempotencyToken string) ApiDeleteOperatorRaftPeerRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiDeleteOperatorRaftPeerRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteOperatorRaftPeerRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOperatorRaftPeerExecute(r) } /* - * DeleteOperatorRaftPeer Method for DeleteOperatorRaftPeer - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiDeleteOperatorRaftPeerRequest - */ -func (a *OperatorApiService) DeleteOperatorRaftPeer(ctx _context.Context) ApiDeleteOperatorRaftPeerRequest { +DeleteOperatorRaftPeer Method for DeleteOperatorRaftPeer + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteOperatorRaftPeerRequest +*/ +func (a *OperatorApiService) DeleteOperatorRaftPeer(ctx context.Context) ApiDeleteOperatorRaftPeerRequest { return ApiDeleteOperatorRaftPeerRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *OperatorApiService) DeleteOperatorRaftPeerExecute(r ApiDeleteOperatorRaftPeerRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *OperatorApiService) DeleteOperatorRaftPeerExecute(r ApiDeleteOperatorRaftPeerRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.DeleteOperatorRaftPeer") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/raft/peer" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -135,7 +135,7 @@ func (a *OperatorApiService) DeleteOperatorRaftPeerExecute(r ApiDeleteOperatorRa } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -145,15 +145,15 @@ func (a *OperatorApiService) DeleteOperatorRaftPeerExecute(r ApiDeleteOperatorRa return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -164,7 +164,7 @@ func (a *OperatorApiService) DeleteOperatorRaftPeerExecute(r ApiDeleteOperatorRa } type ApiGetOperatorAutopilotConfigurationRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService region *string namespace *string @@ -177,83 +177,97 @@ type ApiGetOperatorAutopilotConfigurationRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetOperatorAutopilotConfigurationRequest) Region(region string) ApiGetOperatorAutopilotConfigurationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetOperatorAutopilotConfigurationRequest) Namespace(namespace string) ApiGetOperatorAutopilotConfigurationRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetOperatorAutopilotConfigurationRequest) Index(index int32) ApiGetOperatorAutopilotConfigurationRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetOperatorAutopilotConfigurationRequest) Wait(wait string) ApiGetOperatorAutopilotConfigurationRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetOperatorAutopilotConfigurationRequest) Stale(stale string) ApiGetOperatorAutopilotConfigurationRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetOperatorAutopilotConfigurationRequest) Prefix(prefix string) ApiGetOperatorAutopilotConfigurationRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetOperatorAutopilotConfigurationRequest) XNomadToken(xNomadToken string) ApiGetOperatorAutopilotConfigurationRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetOperatorAutopilotConfigurationRequest) PerPage(perPage int32) ApiGetOperatorAutopilotConfigurationRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetOperatorAutopilotConfigurationRequest) NextToken(nextToken string) ApiGetOperatorAutopilotConfigurationRequest { r.nextToken = &nextToken return r } -func (r ApiGetOperatorAutopilotConfigurationRequest) Execute() (AutopilotConfiguration, *_nethttp.Response, error) { +func (r ApiGetOperatorAutopilotConfigurationRequest) Execute() (*AutopilotConfiguration, *http.Response, error) { return r.ApiService.GetOperatorAutopilotConfigurationExecute(r) } /* - * GetOperatorAutopilotConfiguration Method for GetOperatorAutopilotConfiguration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetOperatorAutopilotConfigurationRequest - */ -func (a *OperatorApiService) GetOperatorAutopilotConfiguration(ctx _context.Context) ApiGetOperatorAutopilotConfigurationRequest { +GetOperatorAutopilotConfiguration Method for GetOperatorAutopilotConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOperatorAutopilotConfigurationRequest +*/ +func (a *OperatorApiService) GetOperatorAutopilotConfiguration(ctx context.Context) ApiGetOperatorAutopilotConfigurationRequest { return ApiGetOperatorAutopilotConfigurationRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return AutopilotConfiguration - */ -func (a *OperatorApiService) GetOperatorAutopilotConfigurationExecute(r ApiGetOperatorAutopilotConfigurationRequest) (AutopilotConfiguration, *_nethttp.Response, error) { +// Execute executes the request +// @return AutopilotConfiguration +func (a *OperatorApiService) GetOperatorAutopilotConfigurationExecute(r ApiGetOperatorAutopilotConfigurationRequest) (*AutopilotConfiguration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AutopilotConfiguration + formFiles []formFile + localVarReturnValue *AutopilotConfiguration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.GetOperatorAutopilotConfiguration") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/autopilot/configuration" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -313,7 +327,7 @@ func (a *OperatorApiService) GetOperatorAutopilotConfigurationExecute(r ApiGetOp } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -323,15 +337,15 @@ func (a *OperatorApiService) GetOperatorAutopilotConfigurationExecute(r ApiGetOp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -340,7 +354,7 @@ func (a *OperatorApiService) GetOperatorAutopilotConfigurationExecute(r ApiGetOp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -351,7 +365,7 @@ func (a *OperatorApiService) GetOperatorAutopilotConfigurationExecute(r ApiGetOp } type ApiGetOperatorAutopilotHealthRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService region *string namespace *string @@ -364,83 +378,97 @@ type ApiGetOperatorAutopilotHealthRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetOperatorAutopilotHealthRequest) Region(region string) ApiGetOperatorAutopilotHealthRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetOperatorAutopilotHealthRequest) Namespace(namespace string) ApiGetOperatorAutopilotHealthRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetOperatorAutopilotHealthRequest) Index(index int32) ApiGetOperatorAutopilotHealthRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetOperatorAutopilotHealthRequest) Wait(wait string) ApiGetOperatorAutopilotHealthRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetOperatorAutopilotHealthRequest) Stale(stale string) ApiGetOperatorAutopilotHealthRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetOperatorAutopilotHealthRequest) Prefix(prefix string) ApiGetOperatorAutopilotHealthRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetOperatorAutopilotHealthRequest) XNomadToken(xNomadToken string) ApiGetOperatorAutopilotHealthRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetOperatorAutopilotHealthRequest) PerPage(perPage int32) ApiGetOperatorAutopilotHealthRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetOperatorAutopilotHealthRequest) NextToken(nextToken string) ApiGetOperatorAutopilotHealthRequest { r.nextToken = &nextToken return r } -func (r ApiGetOperatorAutopilotHealthRequest) Execute() (OperatorHealthReply, *_nethttp.Response, error) { +func (r ApiGetOperatorAutopilotHealthRequest) Execute() (*OperatorHealthReply, *http.Response, error) { return r.ApiService.GetOperatorAutopilotHealthExecute(r) } /* - * GetOperatorAutopilotHealth Method for GetOperatorAutopilotHealth - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetOperatorAutopilotHealthRequest - */ -func (a *OperatorApiService) GetOperatorAutopilotHealth(ctx _context.Context) ApiGetOperatorAutopilotHealthRequest { +GetOperatorAutopilotHealth Method for GetOperatorAutopilotHealth + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOperatorAutopilotHealthRequest +*/ +func (a *OperatorApiService) GetOperatorAutopilotHealth(ctx context.Context) ApiGetOperatorAutopilotHealthRequest { return ApiGetOperatorAutopilotHealthRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return OperatorHealthReply - */ -func (a *OperatorApiService) GetOperatorAutopilotHealthExecute(r ApiGetOperatorAutopilotHealthRequest) (OperatorHealthReply, *_nethttp.Response, error) { +// Execute executes the request +// @return OperatorHealthReply +func (a *OperatorApiService) GetOperatorAutopilotHealthExecute(r ApiGetOperatorAutopilotHealthRequest) (*OperatorHealthReply, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OperatorHealthReply + formFiles []formFile + localVarReturnValue *OperatorHealthReply ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.GetOperatorAutopilotHealth") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/autopilot/health" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -500,7 +528,7 @@ func (a *OperatorApiService) GetOperatorAutopilotHealthExecute(r ApiGetOperatorA } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -510,15 +538,15 @@ func (a *OperatorApiService) GetOperatorAutopilotHealthExecute(r ApiGetOperatorA return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -527,7 +555,7 @@ func (a *OperatorApiService) GetOperatorAutopilotHealthExecute(r ApiGetOperatorA err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -538,7 +566,7 @@ func (a *OperatorApiService) GetOperatorAutopilotHealthExecute(r ApiGetOperatorA } type ApiGetOperatorRaftConfigurationRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService region *string namespace *string @@ -551,83 +579,97 @@ type ApiGetOperatorRaftConfigurationRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetOperatorRaftConfigurationRequest) Region(region string) ApiGetOperatorRaftConfigurationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetOperatorRaftConfigurationRequest) Namespace(namespace string) ApiGetOperatorRaftConfigurationRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetOperatorRaftConfigurationRequest) Index(index int32) ApiGetOperatorRaftConfigurationRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetOperatorRaftConfigurationRequest) Wait(wait string) ApiGetOperatorRaftConfigurationRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetOperatorRaftConfigurationRequest) Stale(stale string) ApiGetOperatorRaftConfigurationRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetOperatorRaftConfigurationRequest) Prefix(prefix string) ApiGetOperatorRaftConfigurationRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetOperatorRaftConfigurationRequest) XNomadToken(xNomadToken string) ApiGetOperatorRaftConfigurationRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetOperatorRaftConfigurationRequest) PerPage(perPage int32) ApiGetOperatorRaftConfigurationRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetOperatorRaftConfigurationRequest) NextToken(nextToken string) ApiGetOperatorRaftConfigurationRequest { r.nextToken = &nextToken return r } -func (r ApiGetOperatorRaftConfigurationRequest) Execute() (RaftConfiguration, *_nethttp.Response, error) { +func (r ApiGetOperatorRaftConfigurationRequest) Execute() (*RaftConfiguration, *http.Response, error) { return r.ApiService.GetOperatorRaftConfigurationExecute(r) } /* - * GetOperatorRaftConfiguration Method for GetOperatorRaftConfiguration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetOperatorRaftConfigurationRequest - */ -func (a *OperatorApiService) GetOperatorRaftConfiguration(ctx _context.Context) ApiGetOperatorRaftConfigurationRequest { +GetOperatorRaftConfiguration Method for GetOperatorRaftConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOperatorRaftConfigurationRequest +*/ +func (a *OperatorApiService) GetOperatorRaftConfiguration(ctx context.Context) ApiGetOperatorRaftConfigurationRequest { return ApiGetOperatorRaftConfigurationRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return RaftConfiguration - */ -func (a *OperatorApiService) GetOperatorRaftConfigurationExecute(r ApiGetOperatorRaftConfigurationRequest) (RaftConfiguration, *_nethttp.Response, error) { +// Execute executes the request +// @return RaftConfiguration +func (a *OperatorApiService) GetOperatorRaftConfigurationExecute(r ApiGetOperatorRaftConfigurationRequest) (*RaftConfiguration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue RaftConfiguration + formFiles []formFile + localVarReturnValue *RaftConfiguration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.GetOperatorRaftConfiguration") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/raft/configuration" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -687,7 +729,7 @@ func (a *OperatorApiService) GetOperatorRaftConfigurationExecute(r ApiGetOperato } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -697,15 +739,15 @@ func (a *OperatorApiService) GetOperatorRaftConfigurationExecute(r ApiGetOperato return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -714,7 +756,7 @@ func (a *OperatorApiService) GetOperatorRaftConfigurationExecute(r ApiGetOperato err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -725,7 +767,7 @@ func (a *OperatorApiService) GetOperatorRaftConfigurationExecute(r ApiGetOperato } type ApiGetOperatorSchedulerConfigurationRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService region *string namespace *string @@ -738,83 +780,97 @@ type ApiGetOperatorSchedulerConfigurationRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetOperatorSchedulerConfigurationRequest) Region(region string) ApiGetOperatorSchedulerConfigurationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetOperatorSchedulerConfigurationRequest) Namespace(namespace string) ApiGetOperatorSchedulerConfigurationRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetOperatorSchedulerConfigurationRequest) Index(index int32) ApiGetOperatorSchedulerConfigurationRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetOperatorSchedulerConfigurationRequest) Wait(wait string) ApiGetOperatorSchedulerConfigurationRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetOperatorSchedulerConfigurationRequest) Stale(stale string) ApiGetOperatorSchedulerConfigurationRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetOperatorSchedulerConfigurationRequest) Prefix(prefix string) ApiGetOperatorSchedulerConfigurationRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetOperatorSchedulerConfigurationRequest) XNomadToken(xNomadToken string) ApiGetOperatorSchedulerConfigurationRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetOperatorSchedulerConfigurationRequest) PerPage(perPage int32) ApiGetOperatorSchedulerConfigurationRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetOperatorSchedulerConfigurationRequest) NextToken(nextToken string) ApiGetOperatorSchedulerConfigurationRequest { r.nextToken = &nextToken return r } -func (r ApiGetOperatorSchedulerConfigurationRequest) Execute() (SchedulerConfigurationResponse, *_nethttp.Response, error) { +func (r ApiGetOperatorSchedulerConfigurationRequest) Execute() (*SchedulerConfigurationResponse, *http.Response, error) { return r.ApiService.GetOperatorSchedulerConfigurationExecute(r) } /* - * GetOperatorSchedulerConfiguration Method for GetOperatorSchedulerConfiguration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetOperatorSchedulerConfigurationRequest - */ -func (a *OperatorApiService) GetOperatorSchedulerConfiguration(ctx _context.Context) ApiGetOperatorSchedulerConfigurationRequest { +GetOperatorSchedulerConfiguration Method for GetOperatorSchedulerConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOperatorSchedulerConfigurationRequest +*/ +func (a *OperatorApiService) GetOperatorSchedulerConfiguration(ctx context.Context) ApiGetOperatorSchedulerConfigurationRequest { return ApiGetOperatorSchedulerConfigurationRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return SchedulerConfigurationResponse - */ -func (a *OperatorApiService) GetOperatorSchedulerConfigurationExecute(r ApiGetOperatorSchedulerConfigurationRequest) (SchedulerConfigurationResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return SchedulerConfigurationResponse +func (a *OperatorApiService) GetOperatorSchedulerConfigurationExecute(r ApiGetOperatorSchedulerConfigurationRequest) (*SchedulerConfigurationResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue SchedulerConfigurationResponse + formFiles []formFile + localVarReturnValue *SchedulerConfigurationResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.GetOperatorSchedulerConfiguration") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/scheduler/configuration" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -874,7 +930,7 @@ func (a *OperatorApiService) GetOperatorSchedulerConfigurationExecute(r ApiGetOp } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -884,15 +940,15 @@ func (a *OperatorApiService) GetOperatorSchedulerConfigurationExecute(r ApiGetOp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -901,7 +957,7 @@ func (a *OperatorApiService) GetOperatorSchedulerConfigurationExecute(r ApiGetOp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -912,7 +968,7 @@ func (a *OperatorApiService) GetOperatorSchedulerConfigurationExecute(r ApiGetOp } type ApiPostOperatorSchedulerConfigurationRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService schedulerConfiguration *SchedulerConfiguration region *string @@ -925,63 +981,68 @@ func (r ApiPostOperatorSchedulerConfigurationRequest) SchedulerConfiguration(sch r.schedulerConfiguration = &schedulerConfiguration return r } + +// Filters results based on the specified region. func (r ApiPostOperatorSchedulerConfigurationRequest) Region(region string) ApiPostOperatorSchedulerConfigurationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostOperatorSchedulerConfigurationRequest) Namespace(namespace string) ApiPostOperatorSchedulerConfigurationRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostOperatorSchedulerConfigurationRequest) XNomadToken(xNomadToken string) ApiPostOperatorSchedulerConfigurationRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostOperatorSchedulerConfigurationRequest) IdempotencyToken(idempotencyToken string) ApiPostOperatorSchedulerConfigurationRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostOperatorSchedulerConfigurationRequest) Execute() (SchedulerSetConfigurationResponse, *_nethttp.Response, error) { +func (r ApiPostOperatorSchedulerConfigurationRequest) Execute() (*SchedulerSetConfigurationResponse, *http.Response, error) { return r.ApiService.PostOperatorSchedulerConfigurationExecute(r) } /* - * PostOperatorSchedulerConfiguration Method for PostOperatorSchedulerConfiguration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostOperatorSchedulerConfigurationRequest - */ -func (a *OperatorApiService) PostOperatorSchedulerConfiguration(ctx _context.Context) ApiPostOperatorSchedulerConfigurationRequest { +PostOperatorSchedulerConfiguration Method for PostOperatorSchedulerConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostOperatorSchedulerConfigurationRequest +*/ +func (a *OperatorApiService) PostOperatorSchedulerConfiguration(ctx context.Context) ApiPostOperatorSchedulerConfigurationRequest { return ApiPostOperatorSchedulerConfigurationRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return SchedulerSetConfigurationResponse - */ -func (a *OperatorApiService) PostOperatorSchedulerConfigurationExecute(r ApiPostOperatorSchedulerConfigurationRequest) (SchedulerSetConfigurationResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return SchedulerSetConfigurationResponse +func (a *OperatorApiService) PostOperatorSchedulerConfigurationExecute(r ApiPostOperatorSchedulerConfigurationRequest) (*SchedulerSetConfigurationResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue SchedulerSetConfigurationResponse + formFiles []formFile + localVarReturnValue *SchedulerSetConfigurationResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.PostOperatorSchedulerConfiguration") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/scheduler/configuration" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.schedulerConfiguration == nil { return localVarReturnValue, nil, reportError("schedulerConfiguration is required and must be specified") } @@ -1031,7 +1092,7 @@ func (a *OperatorApiService) PostOperatorSchedulerConfigurationExecute(r ApiPost } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1041,15 +1102,15 @@ func (a *OperatorApiService) PostOperatorSchedulerConfigurationExecute(r ApiPost return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1058,7 +1119,7 @@ func (a *OperatorApiService) PostOperatorSchedulerConfigurationExecute(r ApiPost err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1069,7 +1130,7 @@ func (a *OperatorApiService) PostOperatorSchedulerConfigurationExecute(r ApiPost } type ApiPutOperatorAutopilotConfigurationRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService autopilotConfiguration *AutopilotConfiguration region *string @@ -1082,63 +1143,68 @@ func (r ApiPutOperatorAutopilotConfigurationRequest) AutopilotConfiguration(auto r.autopilotConfiguration = &autopilotConfiguration return r } + +// Filters results based on the specified region. func (r ApiPutOperatorAutopilotConfigurationRequest) Region(region string) ApiPutOperatorAutopilotConfigurationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPutOperatorAutopilotConfigurationRequest) Namespace(namespace string) ApiPutOperatorAutopilotConfigurationRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPutOperatorAutopilotConfigurationRequest) XNomadToken(xNomadToken string) ApiPutOperatorAutopilotConfigurationRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPutOperatorAutopilotConfigurationRequest) IdempotencyToken(idempotencyToken string) ApiPutOperatorAutopilotConfigurationRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPutOperatorAutopilotConfigurationRequest) Execute() (bool, *_nethttp.Response, error) { +func (r ApiPutOperatorAutopilotConfigurationRequest) Execute() (bool, *http.Response, error) { return r.ApiService.PutOperatorAutopilotConfigurationExecute(r) } /* - * PutOperatorAutopilotConfiguration Method for PutOperatorAutopilotConfiguration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPutOperatorAutopilotConfigurationRequest - */ -func (a *OperatorApiService) PutOperatorAutopilotConfiguration(ctx _context.Context) ApiPutOperatorAutopilotConfigurationRequest { +PutOperatorAutopilotConfiguration Method for PutOperatorAutopilotConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPutOperatorAutopilotConfigurationRequest +*/ +func (a *OperatorApiService) PutOperatorAutopilotConfiguration(ctx context.Context) ApiPutOperatorAutopilotConfigurationRequest { return ApiPutOperatorAutopilotConfigurationRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return bool - */ -func (a *OperatorApiService) PutOperatorAutopilotConfigurationExecute(r ApiPutOperatorAutopilotConfigurationRequest) (bool, *_nethttp.Response, error) { +// Execute executes the request +// @return bool +func (a *OperatorApiService) PutOperatorAutopilotConfigurationExecute(r ApiPutOperatorAutopilotConfigurationRequest) (bool, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.PutOperatorAutopilotConfiguration") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/operator/autopilot/configuration" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.autopilotConfiguration == nil { return localVarReturnValue, nil, reportError("autopilotConfiguration is required and must be specified") } @@ -1188,7 +1254,7 @@ func (a *OperatorApiService) PutOperatorAutopilotConfigurationExecute(r ApiPutOp } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1198,15 +1264,15 @@ func (a *OperatorApiService) PutOperatorAutopilotConfigurationExecute(r ApiPutOp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1215,7 +1281,7 @@ func (a *OperatorApiService) PutOperatorAutopilotConfigurationExecute(r ApiPutOp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_plugins.go b/clients/go/v1/api_plugins.go index ab1ddbc4..dac20599 100644 --- a/clients/go/v1/api_plugins.go +++ b/clients/go/v1/api_plugins.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // PluginsApiService PluginsApi service type PluginsApiService service type ApiGetPluginCSIRequest struct { - ctx _context.Context + ctx context.Context ApiService *PluginsApiService pluginID string region *string @@ -43,54 +39,72 @@ type ApiGetPluginCSIRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetPluginCSIRequest) Region(region string) ApiGetPluginCSIRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetPluginCSIRequest) Namespace(namespace string) ApiGetPluginCSIRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetPluginCSIRequest) Index(index int32) ApiGetPluginCSIRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetPluginCSIRequest) Wait(wait string) ApiGetPluginCSIRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetPluginCSIRequest) Stale(stale string) ApiGetPluginCSIRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetPluginCSIRequest) Prefix(prefix string) ApiGetPluginCSIRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetPluginCSIRequest) XNomadToken(xNomadToken string) ApiGetPluginCSIRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetPluginCSIRequest) PerPage(perPage int32) ApiGetPluginCSIRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetPluginCSIRequest) NextToken(nextToken string) ApiGetPluginCSIRequest { r.nextToken = &nextToken return r } -func (r ApiGetPluginCSIRequest) Execute() ([]CSIPlugin, *_nethttp.Response, error) { +func (r ApiGetPluginCSIRequest) Execute() ([]CSIPlugin, *http.Response, error) { return r.ApiService.GetPluginCSIExecute(r) } /* - * GetPluginCSI Method for GetPluginCSI - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pluginID The CSI plugin identifier. - * @return ApiGetPluginCSIRequest - */ -func (a *PluginsApiService) GetPluginCSI(ctx _context.Context, pluginID string) ApiGetPluginCSIRequest { +GetPluginCSI Method for GetPluginCSI + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pluginID The CSI plugin identifier. + @return ApiGetPluginCSIRequest +*/ +func (a *PluginsApiService) GetPluginCSI(ctx context.Context, pluginID string) ApiGetPluginCSIRequest { return ApiGetPluginCSIRequest{ ApiService: a, ctx: ctx, @@ -98,31 +112,27 @@ func (a *PluginsApiService) GetPluginCSI(ctx _context.Context, pluginID string) } } -/* - * Execute executes the request - * @return []CSIPlugin - */ -func (a *PluginsApiService) GetPluginCSIExecute(r ApiGetPluginCSIRequest) ([]CSIPlugin, *_nethttp.Response, error) { +// Execute executes the request +// @return []CSIPlugin +func (a *PluginsApiService) GetPluginCSIExecute(r ApiGetPluginCSIRequest) ([]CSIPlugin, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []CSIPlugin ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PluginsApiService.GetPluginCSI") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/plugin/csi/{pluginID}" - localVarPath = strings.Replace(localVarPath, "{"+"pluginID"+"}", _neturl.PathEscape(parameterToString(r.pluginID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pluginID"+"}", url.PathEscape(parameterToString(r.pluginID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -182,7 +192,7 @@ func (a *PluginsApiService) GetPluginCSIExecute(r ApiGetPluginCSIRequest) ([]CSI } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -192,15 +202,15 @@ func (a *PluginsApiService) GetPluginCSIExecute(r ApiGetPluginCSIRequest) ([]CSI return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -209,7 +219,7 @@ func (a *PluginsApiService) GetPluginCSIExecute(r ApiGetPluginCSIRequest) ([]CSI err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -220,7 +230,7 @@ func (a *PluginsApiService) GetPluginCSIExecute(r ApiGetPluginCSIRequest) ([]CSI } type ApiGetPluginsRequest struct { - ctx _context.Context + ctx context.Context ApiService *PluginsApiService region *string namespace *string @@ -233,83 +243,97 @@ type ApiGetPluginsRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetPluginsRequest) Region(region string) ApiGetPluginsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetPluginsRequest) Namespace(namespace string) ApiGetPluginsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetPluginsRequest) Index(index int32) ApiGetPluginsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetPluginsRequest) Wait(wait string) ApiGetPluginsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetPluginsRequest) Stale(stale string) ApiGetPluginsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetPluginsRequest) Prefix(prefix string) ApiGetPluginsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetPluginsRequest) XNomadToken(xNomadToken string) ApiGetPluginsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetPluginsRequest) PerPage(perPage int32) ApiGetPluginsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetPluginsRequest) NextToken(nextToken string) ApiGetPluginsRequest { r.nextToken = &nextToken return r } -func (r ApiGetPluginsRequest) Execute() ([]CSIPluginListStub, *_nethttp.Response, error) { +func (r ApiGetPluginsRequest) Execute() ([]CSIPluginListStub, *http.Response, error) { return r.ApiService.GetPluginsExecute(r) } /* - * GetPlugins Method for GetPlugins - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetPluginsRequest - */ -func (a *PluginsApiService) GetPlugins(ctx _context.Context) ApiGetPluginsRequest { +GetPlugins Method for GetPlugins + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPluginsRequest +*/ +func (a *PluginsApiService) GetPlugins(ctx context.Context) ApiGetPluginsRequest { return ApiGetPluginsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []CSIPluginListStub - */ -func (a *PluginsApiService) GetPluginsExecute(r ApiGetPluginsRequest) ([]CSIPluginListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []CSIPluginListStub +func (a *PluginsApiService) GetPluginsExecute(r ApiGetPluginsRequest) ([]CSIPluginListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []CSIPluginListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PluginsApiService.GetPlugins") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/plugins" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -369,7 +393,7 @@ func (a *PluginsApiService) GetPluginsExecute(r ApiGetPluginsRequest) ([]CSIPlug } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -379,15 +403,15 @@ func (a *PluginsApiService) GetPluginsExecute(r ApiGetPluginsRequest) ([]CSIPlug return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -396,7 +420,7 @@ func (a *PluginsApiService) GetPluginsExecute(r ApiGetPluginsRequest) ([]CSIPlug err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_regions.go b/clients/go/v1/api_regions.go index e6829f41..94abe457 100644 --- a/clients/go/v1/api_regions.go +++ b/clients/go/v1/api_regions.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,66 +13,58 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // RegionsApiService RegionsApi service type RegionsApiService service type ApiGetRegionsRequest struct { - ctx _context.Context + ctx context.Context ApiService *RegionsApiService } - -func (r ApiGetRegionsRequest) Execute() ([]string, *_nethttp.Response, error) { +func (r ApiGetRegionsRequest) Execute() ([]string, *http.Response, error) { return r.ApiService.GetRegionsExecute(r) } /* - * GetRegions Method for GetRegions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetRegionsRequest - */ -func (a *RegionsApiService) GetRegions(ctx _context.Context) ApiGetRegionsRequest { +GetRegions Method for GetRegions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRegionsRequest +*/ +func (a *RegionsApiService) GetRegions(ctx context.Context) ApiGetRegionsRequest { return ApiGetRegionsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []string - */ -func (a *RegionsApiService) GetRegionsExecute(r ApiGetRegionsRequest) ([]string, *_nethttp.Response, error) { +// Execute executes the request +// @return []string +func (a *RegionsApiService) GetRegionsExecute(r ApiGetRegionsRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegionsApiService.GetRegions") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/regions" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -105,7 +97,7 @@ func (a *RegionsApiService) GetRegionsExecute(r ApiGetRegionsRequest) ([]string, } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -115,15 +107,15 @@ func (a *RegionsApiService) GetRegionsExecute(r ApiGetRegionsRequest) ([]string, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -132,7 +124,7 @@ func (a *RegionsApiService) GetRegionsExecute(r ApiGetRegionsRequest) ([]string, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_scaling.go b/clients/go/v1/api_scaling.go index b8f26019..b6a26fea 100644 --- a/clients/go/v1/api_scaling.go +++ b/clients/go/v1/api_scaling.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ScalingApiService ScalingApi service type ScalingApiService service type ApiGetScalingPoliciesRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScalingApiService region *string namespace *string @@ -42,83 +38,97 @@ type ApiGetScalingPoliciesRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetScalingPoliciesRequest) Region(region string) ApiGetScalingPoliciesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetScalingPoliciesRequest) Namespace(namespace string) ApiGetScalingPoliciesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetScalingPoliciesRequest) Index(index int32) ApiGetScalingPoliciesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetScalingPoliciesRequest) Wait(wait string) ApiGetScalingPoliciesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetScalingPoliciesRequest) Stale(stale string) ApiGetScalingPoliciesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetScalingPoliciesRequest) Prefix(prefix string) ApiGetScalingPoliciesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetScalingPoliciesRequest) XNomadToken(xNomadToken string) ApiGetScalingPoliciesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetScalingPoliciesRequest) PerPage(perPage int32) ApiGetScalingPoliciesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetScalingPoliciesRequest) NextToken(nextToken string) ApiGetScalingPoliciesRequest { r.nextToken = &nextToken return r } -func (r ApiGetScalingPoliciesRequest) Execute() ([]ScalingPolicyListStub, *_nethttp.Response, error) { +func (r ApiGetScalingPoliciesRequest) Execute() ([]ScalingPolicyListStub, *http.Response, error) { return r.ApiService.GetScalingPoliciesExecute(r) } /* - * GetScalingPolicies Method for GetScalingPolicies - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetScalingPoliciesRequest - */ -func (a *ScalingApiService) GetScalingPolicies(ctx _context.Context) ApiGetScalingPoliciesRequest { +GetScalingPolicies Method for GetScalingPolicies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetScalingPoliciesRequest +*/ +func (a *ScalingApiService) GetScalingPolicies(ctx context.Context) ApiGetScalingPoliciesRequest { return ApiGetScalingPoliciesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []ScalingPolicyListStub - */ -func (a *ScalingApiService) GetScalingPoliciesExecute(r ApiGetScalingPoliciesRequest) ([]ScalingPolicyListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []ScalingPolicyListStub +func (a *ScalingApiService) GetScalingPoliciesExecute(r ApiGetScalingPoliciesRequest) ([]ScalingPolicyListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ScalingPolicyListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScalingApiService.GetScalingPolicies") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/scaling/policies" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -178,7 +188,7 @@ func (a *ScalingApiService) GetScalingPoliciesExecute(r ApiGetScalingPoliciesReq } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -188,15 +198,15 @@ func (a *ScalingApiService) GetScalingPoliciesExecute(r ApiGetScalingPoliciesReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -205,7 +215,7 @@ func (a *ScalingApiService) GetScalingPoliciesExecute(r ApiGetScalingPoliciesReq err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -216,7 +226,7 @@ func (a *ScalingApiService) GetScalingPoliciesExecute(r ApiGetScalingPoliciesReq } type ApiGetScalingPolicyRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScalingApiService policyID string region *string @@ -230,54 +240,72 @@ type ApiGetScalingPolicyRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetScalingPolicyRequest) Region(region string) ApiGetScalingPolicyRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetScalingPolicyRequest) Namespace(namespace string) ApiGetScalingPolicyRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetScalingPolicyRequest) Index(index int32) ApiGetScalingPolicyRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetScalingPolicyRequest) Wait(wait string) ApiGetScalingPolicyRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetScalingPolicyRequest) Stale(stale string) ApiGetScalingPolicyRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetScalingPolicyRequest) Prefix(prefix string) ApiGetScalingPolicyRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetScalingPolicyRequest) XNomadToken(xNomadToken string) ApiGetScalingPolicyRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetScalingPolicyRequest) PerPage(perPage int32) ApiGetScalingPolicyRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetScalingPolicyRequest) NextToken(nextToken string) ApiGetScalingPolicyRequest { r.nextToken = &nextToken return r } -func (r ApiGetScalingPolicyRequest) Execute() (ScalingPolicy, *_nethttp.Response, error) { +func (r ApiGetScalingPolicyRequest) Execute() (*ScalingPolicy, *http.Response, error) { return r.ApiService.GetScalingPolicyExecute(r) } /* - * GetScalingPolicy Method for GetScalingPolicy - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyID The scaling policy identifier. - * @return ApiGetScalingPolicyRequest - */ -func (a *ScalingApiService) GetScalingPolicy(ctx _context.Context, policyID string) ApiGetScalingPolicyRequest { +GetScalingPolicy Method for GetScalingPolicy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyID The scaling policy identifier. + @return ApiGetScalingPolicyRequest +*/ +func (a *ScalingApiService) GetScalingPolicy(ctx context.Context, policyID string) ApiGetScalingPolicyRequest { return ApiGetScalingPolicyRequest{ ApiService: a, ctx: ctx, @@ -285,31 +313,27 @@ func (a *ScalingApiService) GetScalingPolicy(ctx _context.Context, policyID stri } } -/* - * Execute executes the request - * @return ScalingPolicy - */ -func (a *ScalingApiService) GetScalingPolicyExecute(r ApiGetScalingPolicyRequest) (ScalingPolicy, *_nethttp.Response, error) { +// Execute executes the request +// @return ScalingPolicy +func (a *ScalingApiService) GetScalingPolicyExecute(r ApiGetScalingPolicyRequest) (*ScalingPolicy, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ScalingPolicy + formFiles []formFile + localVarReturnValue *ScalingPolicy ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScalingApiService.GetScalingPolicy") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/scaling/policy/{policyID}" - localVarPath = strings.Replace(localVarPath, "{"+"policyID"+"}", _neturl.PathEscape(parameterToString(r.policyID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"policyID"+"}", url.PathEscape(parameterToString(r.policyID, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -369,7 +393,7 @@ func (a *ScalingApiService) GetScalingPolicyExecute(r ApiGetScalingPolicyRequest } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -379,15 +403,15 @@ func (a *ScalingApiService) GetScalingPolicyExecute(r ApiGetScalingPolicyRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -396,7 +420,7 @@ func (a *ScalingApiService) GetScalingPolicyExecute(r ApiGetScalingPolicyRequest err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_search.go b/clients/go/v1/api_search.go index 0544c91a..2e334c42 100644 --- a/clients/go/v1/api_search.go +++ b/clients/go/v1/api_search.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,22 +13,18 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // SearchApiService SearchApi service type SearchApiService service type ApiGetFuzzySearchRequest struct { - ctx _context.Context + ctx context.Context ApiService *SearchApiService fuzzySearchRequest *FuzzySearchRequest region *string @@ -46,83 +42,98 @@ func (r ApiGetFuzzySearchRequest) FuzzySearchRequest(fuzzySearchRequest FuzzySea r.fuzzySearchRequest = &fuzzySearchRequest return r } + +// Filters results based on the specified region. func (r ApiGetFuzzySearchRequest) Region(region string) ApiGetFuzzySearchRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetFuzzySearchRequest) Namespace(namespace string) ApiGetFuzzySearchRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetFuzzySearchRequest) Index(index int32) ApiGetFuzzySearchRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetFuzzySearchRequest) Wait(wait string) ApiGetFuzzySearchRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetFuzzySearchRequest) Stale(stale string) ApiGetFuzzySearchRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetFuzzySearchRequest) Prefix(prefix string) ApiGetFuzzySearchRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetFuzzySearchRequest) XNomadToken(xNomadToken string) ApiGetFuzzySearchRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetFuzzySearchRequest) PerPage(perPage int32) ApiGetFuzzySearchRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetFuzzySearchRequest) NextToken(nextToken string) ApiGetFuzzySearchRequest { r.nextToken = &nextToken return r } -func (r ApiGetFuzzySearchRequest) Execute() (FuzzySearchResponse, *_nethttp.Response, error) { +func (r ApiGetFuzzySearchRequest) Execute() (*FuzzySearchResponse, *http.Response, error) { return r.ApiService.GetFuzzySearchExecute(r) } /* - * GetFuzzySearch Method for GetFuzzySearch - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetFuzzySearchRequest - */ -func (a *SearchApiService) GetFuzzySearch(ctx _context.Context) ApiGetFuzzySearchRequest { +GetFuzzySearch Method for GetFuzzySearch + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetFuzzySearchRequest +*/ +func (a *SearchApiService) GetFuzzySearch(ctx context.Context) ApiGetFuzzySearchRequest { return ApiGetFuzzySearchRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return FuzzySearchResponse - */ -func (a *SearchApiService) GetFuzzySearchExecute(r ApiGetFuzzySearchRequest) (FuzzySearchResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return FuzzySearchResponse +func (a *SearchApiService) GetFuzzySearchExecute(r ApiGetFuzzySearchRequest) (*FuzzySearchResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue FuzzySearchResponse + formFiles []formFile + localVarReturnValue *FuzzySearchResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SearchApiService.GetFuzzySearch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/search/fuzzy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.fuzzySearchRequest == nil { return localVarReturnValue, nil, reportError("fuzzySearchRequest is required and must be specified") } @@ -187,7 +198,7 @@ func (a *SearchApiService) GetFuzzySearchExecute(r ApiGetFuzzySearchRequest) (Fu } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -197,15 +208,15 @@ func (a *SearchApiService) GetFuzzySearchExecute(r ApiGetFuzzySearchRequest) (Fu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -214,7 +225,7 @@ func (a *SearchApiService) GetFuzzySearchExecute(r ApiGetFuzzySearchRequest) (Fu err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -225,7 +236,7 @@ func (a *SearchApiService) GetFuzzySearchExecute(r ApiGetFuzzySearchRequest) (Fu } type ApiGetSearchRequest struct { - ctx _context.Context + ctx context.Context ApiService *SearchApiService searchRequest *SearchRequest region *string @@ -243,83 +254,98 @@ func (r ApiGetSearchRequest) SearchRequest(searchRequest SearchRequest) ApiGetSe r.searchRequest = &searchRequest return r } + +// Filters results based on the specified region. func (r ApiGetSearchRequest) Region(region string) ApiGetSearchRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetSearchRequest) Namespace(namespace string) ApiGetSearchRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetSearchRequest) Index(index int32) ApiGetSearchRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetSearchRequest) Wait(wait string) ApiGetSearchRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetSearchRequest) Stale(stale string) ApiGetSearchRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetSearchRequest) Prefix(prefix string) ApiGetSearchRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetSearchRequest) XNomadToken(xNomadToken string) ApiGetSearchRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetSearchRequest) PerPage(perPage int32) ApiGetSearchRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetSearchRequest) NextToken(nextToken string) ApiGetSearchRequest { r.nextToken = &nextToken return r } -func (r ApiGetSearchRequest) Execute() (SearchResponse, *_nethttp.Response, error) { +func (r ApiGetSearchRequest) Execute() (*SearchResponse, *http.Response, error) { return r.ApiService.GetSearchExecute(r) } /* - * GetSearch Method for GetSearch - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetSearchRequest - */ -func (a *SearchApiService) GetSearch(ctx _context.Context) ApiGetSearchRequest { +GetSearch Method for GetSearch + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSearchRequest +*/ +func (a *SearchApiService) GetSearch(ctx context.Context) ApiGetSearchRequest { return ApiGetSearchRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return SearchResponse - */ -func (a *SearchApiService) GetSearchExecute(r ApiGetSearchRequest) (SearchResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return SearchResponse +func (a *SearchApiService) GetSearchExecute(r ApiGetSearchRequest) (*SearchResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue SearchResponse + formFiles []formFile + localVarReturnValue *SearchResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SearchApiService.GetSearch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/search" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.searchRequest == nil { return localVarReturnValue, nil, reportError("searchRequest is required and must be specified") } @@ -384,7 +410,7 @@ func (a *SearchApiService) GetSearchExecute(r ApiGetSearchRequest) (SearchRespon } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -394,15 +420,15 @@ func (a *SearchApiService) GetSearchExecute(r ApiGetSearchRequest) (SearchRespon return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -411,7 +437,7 @@ func (a *SearchApiService) GetSearchExecute(r ApiGetSearchRequest) (SearchRespon err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_status.go b/clients/go/v1/api_status.go index 49c546fd..2da221ae 100644 --- a/clients/go/v1/api_status.go +++ b/clients/go/v1/api_status.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,22 +13,18 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // StatusApiService StatusApi service type StatusApiService service type ApiGetStatusLeaderRequest struct { - ctx _context.Context + ctx context.Context ApiService *StatusApiService region *string namespace *string @@ -41,83 +37,97 @@ type ApiGetStatusLeaderRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetStatusLeaderRequest) Region(region string) ApiGetStatusLeaderRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetStatusLeaderRequest) Namespace(namespace string) ApiGetStatusLeaderRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetStatusLeaderRequest) Index(index int32) ApiGetStatusLeaderRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetStatusLeaderRequest) Wait(wait string) ApiGetStatusLeaderRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetStatusLeaderRequest) Stale(stale string) ApiGetStatusLeaderRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetStatusLeaderRequest) Prefix(prefix string) ApiGetStatusLeaderRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetStatusLeaderRequest) XNomadToken(xNomadToken string) ApiGetStatusLeaderRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetStatusLeaderRequest) PerPage(perPage int32) ApiGetStatusLeaderRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetStatusLeaderRequest) NextToken(nextToken string) ApiGetStatusLeaderRequest { r.nextToken = &nextToken return r } -func (r ApiGetStatusLeaderRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiGetStatusLeaderRequest) Execute() (string, *http.Response, error) { return r.ApiService.GetStatusLeaderExecute(r) } /* - * GetStatusLeader Method for GetStatusLeader - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetStatusLeaderRequest - */ -func (a *StatusApiService) GetStatusLeader(ctx _context.Context) ApiGetStatusLeaderRequest { +GetStatusLeader Method for GetStatusLeader + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusLeaderRequest +*/ +func (a *StatusApiService) GetStatusLeader(ctx context.Context) ApiGetStatusLeaderRequest { return ApiGetStatusLeaderRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return string - */ -func (a *StatusApiService) GetStatusLeaderExecute(r ApiGetStatusLeaderRequest) (string, *_nethttp.Response, error) { +// Execute executes the request +// @return string +func (a *StatusApiService) GetStatusLeaderExecute(r ApiGetStatusLeaderRequest) (string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatusApiService.GetStatusLeader") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/status/leader" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -177,7 +187,7 @@ func (a *StatusApiService) GetStatusLeaderExecute(r ApiGetStatusLeaderRequest) ( } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -187,15 +197,15 @@ func (a *StatusApiService) GetStatusLeaderExecute(r ApiGetStatusLeaderRequest) ( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -204,7 +214,7 @@ func (a *StatusApiService) GetStatusLeaderExecute(r ApiGetStatusLeaderRequest) ( err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -215,7 +225,7 @@ func (a *StatusApiService) GetStatusLeaderExecute(r ApiGetStatusLeaderRequest) ( } type ApiGetStatusPeersRequest struct { - ctx _context.Context + ctx context.Context ApiService *StatusApiService region *string namespace *string @@ -228,83 +238,97 @@ type ApiGetStatusPeersRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetStatusPeersRequest) Region(region string) ApiGetStatusPeersRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetStatusPeersRequest) Namespace(namespace string) ApiGetStatusPeersRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetStatusPeersRequest) Index(index int32) ApiGetStatusPeersRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetStatusPeersRequest) Wait(wait string) ApiGetStatusPeersRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetStatusPeersRequest) Stale(stale string) ApiGetStatusPeersRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetStatusPeersRequest) Prefix(prefix string) ApiGetStatusPeersRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetStatusPeersRequest) XNomadToken(xNomadToken string) ApiGetStatusPeersRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetStatusPeersRequest) PerPage(perPage int32) ApiGetStatusPeersRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetStatusPeersRequest) NextToken(nextToken string) ApiGetStatusPeersRequest { r.nextToken = &nextToken return r } -func (r ApiGetStatusPeersRequest) Execute() ([]string, *_nethttp.Response, error) { +func (r ApiGetStatusPeersRequest) Execute() ([]string, *http.Response, error) { return r.ApiService.GetStatusPeersExecute(r) } /* - * GetStatusPeers Method for GetStatusPeers - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetStatusPeersRequest - */ -func (a *StatusApiService) GetStatusPeers(ctx _context.Context) ApiGetStatusPeersRequest { +GetStatusPeers Method for GetStatusPeers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusPeersRequest +*/ +func (a *StatusApiService) GetStatusPeers(ctx context.Context) ApiGetStatusPeersRequest { return ApiGetStatusPeersRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []string - */ -func (a *StatusApiService) GetStatusPeersExecute(r ApiGetStatusPeersRequest) ([]string, *_nethttp.Response, error) { +// Execute executes the request +// @return []string +func (a *StatusApiService) GetStatusPeersExecute(r ApiGetStatusPeersRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatusApiService.GetStatusPeers") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/status/peers" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -364,7 +388,7 @@ func (a *StatusApiService) GetStatusPeersExecute(r ApiGetStatusPeersRequest) ([] } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -374,15 +398,15 @@ func (a *StatusApiService) GetStatusPeersExecute(r ApiGetStatusPeersRequest) ([] return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -391,7 +415,7 @@ func (a *StatusApiService) GetStatusPeersExecute(r ApiGetStatusPeersRequest) ([] err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/clients/go/v1/api_system.go b/clients/go/v1/api_system.go index 3a9273c8..7956c026 100644 --- a/clients/go/v1/api_system.go +++ b/clients/go/v1/api_system.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,22 +13,18 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // SystemApiService SystemApi service type SystemApiService service type ApiPutSystemGCRequest struct { - ctx _context.Context + ctx context.Context ApiService *SystemApiService region *string namespace *string @@ -36,61 +32,65 @@ type ApiPutSystemGCRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiPutSystemGCRequest) Region(region string) ApiPutSystemGCRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPutSystemGCRequest) Namespace(namespace string) ApiPutSystemGCRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPutSystemGCRequest) XNomadToken(xNomadToken string) ApiPutSystemGCRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPutSystemGCRequest) IdempotencyToken(idempotencyToken string) ApiPutSystemGCRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPutSystemGCRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPutSystemGCRequest) Execute() (*http.Response, error) { return r.ApiService.PutSystemGCExecute(r) } /* - * PutSystemGC Method for PutSystemGC - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPutSystemGCRequest - */ -func (a *SystemApiService) PutSystemGC(ctx _context.Context) ApiPutSystemGCRequest { +PutSystemGC Method for PutSystemGC + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPutSystemGCRequest +*/ +func (a *SystemApiService) PutSystemGC(ctx context.Context) ApiPutSystemGCRequest { return ApiPutSystemGCRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *SystemApiService) PutSystemGCExecute(r ApiPutSystemGCRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *SystemApiService) PutSystemGCExecute(r ApiPutSystemGCRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.PutSystemGC") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/system/gc" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -135,7 +135,7 @@ func (a *SystemApiService) PutSystemGCExecute(r ApiPutSystemGCRequest) (*_nethtt } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -145,15 +145,15 @@ func (a *SystemApiService) PutSystemGCExecute(r ApiPutSystemGCRequest) (*_nethtt return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -164,7 +164,7 @@ func (a *SystemApiService) PutSystemGCExecute(r ApiPutSystemGCRequest) (*_nethtt } type ApiPutSystemReconcileSummariesRequest struct { - ctx _context.Context + ctx context.Context ApiService *SystemApiService region *string namespace *string @@ -172,61 +172,65 @@ type ApiPutSystemReconcileSummariesRequest struct { idempotencyToken *string } +// Filters results based on the specified region. func (r ApiPutSystemReconcileSummariesRequest) Region(region string) ApiPutSystemReconcileSummariesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPutSystemReconcileSummariesRequest) Namespace(namespace string) ApiPutSystemReconcileSummariesRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPutSystemReconcileSummariesRequest) XNomadToken(xNomadToken string) ApiPutSystemReconcileSummariesRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPutSystemReconcileSummariesRequest) IdempotencyToken(idempotencyToken string) ApiPutSystemReconcileSummariesRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPutSystemReconcileSummariesRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPutSystemReconcileSummariesRequest) Execute() (*http.Response, error) { return r.ApiService.PutSystemReconcileSummariesExecute(r) } /* - * PutSystemReconcileSummaries Method for PutSystemReconcileSummaries - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPutSystemReconcileSummariesRequest - */ -func (a *SystemApiService) PutSystemReconcileSummaries(ctx _context.Context) ApiPutSystemReconcileSummariesRequest { +PutSystemReconcileSummaries Method for PutSystemReconcileSummaries + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPutSystemReconcileSummariesRequest +*/ +func (a *SystemApiService) PutSystemReconcileSummaries(ctx context.Context) ApiPutSystemReconcileSummariesRequest { return ApiPutSystemReconcileSummariesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *SystemApiService) PutSystemReconcileSummariesExecute(r ApiPutSystemReconcileSummariesRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *SystemApiService) PutSystemReconcileSummariesExecute(r ApiPutSystemReconcileSummariesRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.PutSystemReconcileSummaries") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/system/reconcile/summaries" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -271,7 +275,7 @@ func (a *SystemApiService) PutSystemReconcileSummariesExecute(r ApiPutSystemReco } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -281,15 +285,15 @@ func (a *SystemApiService) PutSystemReconcileSummariesExecute(r ApiPutSystemReco return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/clients/go/v1/api_volumes.go b/clients/go/v1/api_volumes.go index 70a70346..365f3249 100644 --- a/clients/go/v1/api_volumes.go +++ b/clients/go/v1/api_volumes.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,23 +13,19 @@ package client import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // VolumesApiService VolumesApi service type VolumesApiService service type ApiCreateVolumeRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService volumeId string action string @@ -44,35 +40,44 @@ func (r ApiCreateVolumeRequest) CSIVolumeCreateRequest(cSIVolumeCreateRequest CS r.cSIVolumeCreateRequest = &cSIVolumeCreateRequest return r } + +// Filters results based on the specified region. func (r ApiCreateVolumeRequest) Region(region string) ApiCreateVolumeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiCreateVolumeRequest) Namespace(namespace string) ApiCreateVolumeRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiCreateVolumeRequest) XNomadToken(xNomadToken string) ApiCreateVolumeRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiCreateVolumeRequest) IdempotencyToken(idempotencyToken string) ApiCreateVolumeRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiCreateVolumeRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateVolumeRequest) Execute() (*http.Response, error) { return r.ApiService.CreateVolumeExecute(r) } /* - * CreateVolume Method for CreateVolume - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param volumeId Volume unique identifier. - * @param action The action to perform on the Volume (create, detach, delete). - * @return ApiCreateVolumeRequest - */ -func (a *VolumesApiService) CreateVolume(ctx _context.Context, volumeId string, action string) ApiCreateVolumeRequest { +CreateVolume Method for CreateVolume + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param volumeId Volume unique identifier. + @param action The action to perform on the Volume (create, detach, delete). + @return ApiCreateVolumeRequest +*/ +func (a *VolumesApiService) CreateVolume(ctx context.Context, volumeId string, action string) ApiCreateVolumeRequest { return ApiCreateVolumeRequest{ ApiService: a, ctx: ctx, @@ -81,30 +86,26 @@ func (a *VolumesApiService) CreateVolume(ctx _context.Context, volumeId string, } } -/* - * Execute executes the request - */ -func (a *VolumesApiService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *VolumesApiService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.CreateVolume") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volume/csi/{volumeId}/{action}" - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"action"+"}", _neturl.PathEscape(parameterToString(r.action, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterToString(r.volumeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"action"+"}", url.PathEscape(parameterToString(r.action, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.cSIVolumeCreateRequest == nil { return nil, reportError("cSIVolumeCreateRequest is required and must be specified") } @@ -154,7 +155,7 @@ func (a *VolumesApiService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*_net } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -164,15 +165,15 @@ func (a *VolumesApiService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*_net return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -183,7 +184,7 @@ func (a *VolumesApiService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*_net } type ApiDeleteSnapshotRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService region *string namespace *string @@ -193,69 +194,77 @@ type ApiDeleteSnapshotRequest struct { snapshotId *string } +// Filters results based on the specified region. func (r ApiDeleteSnapshotRequest) Region(region string) ApiDeleteSnapshotRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteSnapshotRequest) Namespace(namespace string) ApiDeleteSnapshotRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteSnapshotRequest) XNomadToken(xNomadToken string) ApiDeleteSnapshotRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteSnapshotRequest) IdempotencyToken(idempotencyToken string) ApiDeleteSnapshotRequest { r.idempotencyToken = &idempotencyToken return r } + +// Filters volume lists by plugin ID. func (r ApiDeleteSnapshotRequest) PluginId(pluginId string) ApiDeleteSnapshotRequest { r.pluginId = &pluginId return r } + +// The ID of the snapshot to target. func (r ApiDeleteSnapshotRequest) SnapshotId(snapshotId string) ApiDeleteSnapshotRequest { r.snapshotId = &snapshotId return r } -func (r ApiDeleteSnapshotRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteSnapshotRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteSnapshotExecute(r) } /* - * DeleteSnapshot Method for DeleteSnapshot - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiDeleteSnapshotRequest - */ -func (a *VolumesApiService) DeleteSnapshot(ctx _context.Context) ApiDeleteSnapshotRequest { +DeleteSnapshot Method for DeleteSnapshot + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteSnapshotRequest +*/ +func (a *VolumesApiService) DeleteSnapshot(ctx context.Context) ApiDeleteSnapshotRequest { return ApiDeleteSnapshotRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *VolumesApiService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *VolumesApiService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DeleteSnapshot") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volumes/snapshot" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -306,7 +315,7 @@ func (a *VolumesApiService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (* } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -316,15 +325,15 @@ func (a *VolumesApiService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (* return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -335,7 +344,7 @@ func (a *VolumesApiService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (* } type ApiDeleteVolumeRegistrationRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService volumeId string region *string @@ -345,38 +354,48 @@ type ApiDeleteVolumeRegistrationRequest struct { force *string } +// Filters results based on the specified region. func (r ApiDeleteVolumeRegistrationRequest) Region(region string) ApiDeleteVolumeRegistrationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDeleteVolumeRegistrationRequest) Namespace(namespace string) ApiDeleteVolumeRegistrationRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDeleteVolumeRegistrationRequest) XNomadToken(xNomadToken string) ApiDeleteVolumeRegistrationRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDeleteVolumeRegistrationRequest) IdempotencyToken(idempotencyToken string) ApiDeleteVolumeRegistrationRequest { r.idempotencyToken = &idempotencyToken return r } + +// Used to force the de-registration of a volume. func (r ApiDeleteVolumeRegistrationRequest) Force(force string) ApiDeleteVolumeRegistrationRequest { r.force = &force return r } -func (r ApiDeleteVolumeRegistrationRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteVolumeRegistrationRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteVolumeRegistrationExecute(r) } /* - * DeleteVolumeRegistration Method for DeleteVolumeRegistration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param volumeId Volume unique identifier. - * @return ApiDeleteVolumeRegistrationRequest - */ -func (a *VolumesApiService) DeleteVolumeRegistration(ctx _context.Context, volumeId string) ApiDeleteVolumeRegistrationRequest { +DeleteVolumeRegistration Method for DeleteVolumeRegistration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param volumeId Volume unique identifier. + @return ApiDeleteVolumeRegistrationRequest +*/ +func (a *VolumesApiService) DeleteVolumeRegistration(ctx context.Context, volumeId string) ApiDeleteVolumeRegistrationRequest { return ApiDeleteVolumeRegistrationRequest{ ApiService: a, ctx: ctx, @@ -384,29 +403,25 @@ func (a *VolumesApiService) DeleteVolumeRegistration(ctx _context.Context, volum } } -/* - * Execute executes the request - */ -func (a *VolumesApiService) DeleteVolumeRegistrationExecute(r ApiDeleteVolumeRegistrationRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *VolumesApiService) DeleteVolumeRegistrationExecute(r ApiDeleteVolumeRegistrationRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DeleteVolumeRegistration") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volume/csi/{volumeId}" - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterToString(r.volumeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -454,7 +469,7 @@ func (a *VolumesApiService) DeleteVolumeRegistrationExecute(r ApiDeleteVolumeReg } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -464,15 +479,15 @@ func (a *VolumesApiService) DeleteVolumeRegistrationExecute(r ApiDeleteVolumeReg return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -483,7 +498,7 @@ func (a *VolumesApiService) DeleteVolumeRegistrationExecute(r ApiDeleteVolumeReg } type ApiDetachOrDeleteVolumeRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService volumeId string action string @@ -494,39 +509,49 @@ type ApiDetachOrDeleteVolumeRequest struct { node *string } +// Filters results based on the specified region. func (r ApiDetachOrDeleteVolumeRequest) Region(region string) ApiDetachOrDeleteVolumeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiDetachOrDeleteVolumeRequest) Namespace(namespace string) ApiDetachOrDeleteVolumeRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiDetachOrDeleteVolumeRequest) XNomadToken(xNomadToken string) ApiDetachOrDeleteVolumeRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiDetachOrDeleteVolumeRequest) IdempotencyToken(idempotencyToken string) ApiDetachOrDeleteVolumeRequest { r.idempotencyToken = &idempotencyToken return r } + +// Specifies node to target volume operation for. func (r ApiDetachOrDeleteVolumeRequest) Node(node string) ApiDetachOrDeleteVolumeRequest { r.node = &node return r } -func (r ApiDetachOrDeleteVolumeRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDetachOrDeleteVolumeRequest) Execute() (*http.Response, error) { return r.ApiService.DetachOrDeleteVolumeExecute(r) } /* - * DetachOrDeleteVolume Method for DetachOrDeleteVolume - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param volumeId Volume unique identifier. - * @param action The action to perform on the Volume (create, detach, delete). - * @return ApiDetachOrDeleteVolumeRequest - */ -func (a *VolumesApiService) DetachOrDeleteVolume(ctx _context.Context, volumeId string, action string) ApiDetachOrDeleteVolumeRequest { +DetachOrDeleteVolume Method for DetachOrDeleteVolume + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param volumeId Volume unique identifier. + @param action The action to perform on the Volume (create, detach, delete). + @return ApiDetachOrDeleteVolumeRequest +*/ +func (a *VolumesApiService) DetachOrDeleteVolume(ctx context.Context, volumeId string, action string) ApiDetachOrDeleteVolumeRequest { return ApiDetachOrDeleteVolumeRequest{ ApiService: a, ctx: ctx, @@ -535,30 +560,26 @@ func (a *VolumesApiService) DetachOrDeleteVolume(ctx _context.Context, volumeId } } -/* - * Execute executes the request - */ -func (a *VolumesApiService) DetachOrDeleteVolumeExecute(r ApiDetachOrDeleteVolumeRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *VolumesApiService) DetachOrDeleteVolumeExecute(r ApiDetachOrDeleteVolumeRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DetachOrDeleteVolume") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volume/csi/{volumeId}/{action}" - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"action"+"}", _neturl.PathEscape(parameterToString(r.action, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterToString(r.volumeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"action"+"}", url.PathEscape(parameterToString(r.action, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -606,7 +627,7 @@ func (a *VolumesApiService) DetachOrDeleteVolumeExecute(r ApiDetachOrDeleteVolum } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -616,15 +637,15 @@ func (a *VolumesApiService) DetachOrDeleteVolumeExecute(r ApiDetachOrDeleteVolum return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -635,7 +656,7 @@ func (a *VolumesApiService) DetachOrDeleteVolumeExecute(r ApiDetachOrDeleteVolum } type ApiGetExternalVolumesRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService region *string namespace *string @@ -649,87 +670,103 @@ type ApiGetExternalVolumesRequest struct { pluginId *string } +// Filters results based on the specified region. func (r ApiGetExternalVolumesRequest) Region(region string) ApiGetExternalVolumesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetExternalVolumesRequest) Namespace(namespace string) ApiGetExternalVolumesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetExternalVolumesRequest) Index(index int32) ApiGetExternalVolumesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetExternalVolumesRequest) Wait(wait string) ApiGetExternalVolumesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetExternalVolumesRequest) Stale(stale string) ApiGetExternalVolumesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetExternalVolumesRequest) Prefix(prefix string) ApiGetExternalVolumesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetExternalVolumesRequest) XNomadToken(xNomadToken string) ApiGetExternalVolumesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetExternalVolumesRequest) PerPage(perPage int32) ApiGetExternalVolumesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetExternalVolumesRequest) NextToken(nextToken string) ApiGetExternalVolumesRequest { r.nextToken = &nextToken return r } + +// Filters volume lists by plugin ID. func (r ApiGetExternalVolumesRequest) PluginId(pluginId string) ApiGetExternalVolumesRequest { r.pluginId = &pluginId return r } -func (r ApiGetExternalVolumesRequest) Execute() (CSIVolumeListExternalResponse, *_nethttp.Response, error) { +func (r ApiGetExternalVolumesRequest) Execute() (*CSIVolumeListExternalResponse, *http.Response, error) { return r.ApiService.GetExternalVolumesExecute(r) } /* - * GetExternalVolumes Method for GetExternalVolumes - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetExternalVolumesRequest - */ -func (a *VolumesApiService) GetExternalVolumes(ctx _context.Context) ApiGetExternalVolumesRequest { +GetExternalVolumes Method for GetExternalVolumes + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetExternalVolumesRequest +*/ +func (a *VolumesApiService) GetExternalVolumes(ctx context.Context) ApiGetExternalVolumesRequest { return ApiGetExternalVolumesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return CSIVolumeListExternalResponse - */ -func (a *VolumesApiService) GetExternalVolumesExecute(r ApiGetExternalVolumesRequest) (CSIVolumeListExternalResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return CSIVolumeListExternalResponse +func (a *VolumesApiService) GetExternalVolumesExecute(r ApiGetExternalVolumesRequest) (*CSIVolumeListExternalResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CSIVolumeListExternalResponse + formFiles []formFile + localVarReturnValue *CSIVolumeListExternalResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.GetExternalVolumes") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volumes/external" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -792,7 +829,7 @@ func (a *VolumesApiService) GetExternalVolumesExecute(r ApiGetExternalVolumesReq } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -802,15 +839,15 @@ func (a *VolumesApiService) GetExternalVolumesExecute(r ApiGetExternalVolumesReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -819,7 +856,7 @@ func (a *VolumesApiService) GetExternalVolumesExecute(r ApiGetExternalVolumesReq err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -830,7 +867,7 @@ func (a *VolumesApiService) GetExternalVolumesExecute(r ApiGetExternalVolumesReq } type ApiGetSnapshotsRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService region *string namespace *string @@ -844,87 +881,103 @@ type ApiGetSnapshotsRequest struct { pluginId *string } +// Filters results based on the specified region. func (r ApiGetSnapshotsRequest) Region(region string) ApiGetSnapshotsRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetSnapshotsRequest) Namespace(namespace string) ApiGetSnapshotsRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetSnapshotsRequest) Index(index int32) ApiGetSnapshotsRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetSnapshotsRequest) Wait(wait string) ApiGetSnapshotsRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetSnapshotsRequest) Stale(stale string) ApiGetSnapshotsRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetSnapshotsRequest) Prefix(prefix string) ApiGetSnapshotsRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetSnapshotsRequest) XNomadToken(xNomadToken string) ApiGetSnapshotsRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetSnapshotsRequest) PerPage(perPage int32) ApiGetSnapshotsRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetSnapshotsRequest) NextToken(nextToken string) ApiGetSnapshotsRequest { r.nextToken = &nextToken return r } + +// Filters volume lists by plugin ID. func (r ApiGetSnapshotsRequest) PluginId(pluginId string) ApiGetSnapshotsRequest { r.pluginId = &pluginId return r } -func (r ApiGetSnapshotsRequest) Execute() (CSISnapshotListResponse, *_nethttp.Response, error) { +func (r ApiGetSnapshotsRequest) Execute() (*CSISnapshotListResponse, *http.Response, error) { return r.ApiService.GetSnapshotsExecute(r) } /* - * GetSnapshots Method for GetSnapshots - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetSnapshotsRequest - */ -func (a *VolumesApiService) GetSnapshots(ctx _context.Context) ApiGetSnapshotsRequest { +GetSnapshots Method for GetSnapshots + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSnapshotsRequest +*/ +func (a *VolumesApiService) GetSnapshots(ctx context.Context) ApiGetSnapshotsRequest { return ApiGetSnapshotsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return CSISnapshotListResponse - */ -func (a *VolumesApiService) GetSnapshotsExecute(r ApiGetSnapshotsRequest) (CSISnapshotListResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return CSISnapshotListResponse +func (a *VolumesApiService) GetSnapshotsExecute(r ApiGetSnapshotsRequest) (*CSISnapshotListResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CSISnapshotListResponse + formFiles []formFile + localVarReturnValue *CSISnapshotListResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.GetSnapshots") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volumes/snapshot" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -987,7 +1040,7 @@ func (a *VolumesApiService) GetSnapshotsExecute(r ApiGetSnapshotsRequest) (CSISn } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -997,15 +1050,15 @@ func (a *VolumesApiService) GetSnapshotsExecute(r ApiGetSnapshotsRequest) (CSISn return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1014,7 +1067,7 @@ func (a *VolumesApiService) GetSnapshotsExecute(r ApiGetSnapshotsRequest) (CSISn err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1025,7 +1078,7 @@ func (a *VolumesApiService) GetSnapshotsExecute(r ApiGetSnapshotsRequest) (CSISn } type ApiGetVolumeRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService volumeId string region *string @@ -1039,54 +1092,72 @@ type ApiGetVolumeRequest struct { nextToken *string } +// Filters results based on the specified region. func (r ApiGetVolumeRequest) Region(region string) ApiGetVolumeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetVolumeRequest) Namespace(namespace string) ApiGetVolumeRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetVolumeRequest) Index(index int32) ApiGetVolumeRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetVolumeRequest) Wait(wait string) ApiGetVolumeRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetVolumeRequest) Stale(stale string) ApiGetVolumeRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetVolumeRequest) Prefix(prefix string) ApiGetVolumeRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetVolumeRequest) XNomadToken(xNomadToken string) ApiGetVolumeRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetVolumeRequest) PerPage(perPage int32) ApiGetVolumeRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetVolumeRequest) NextToken(nextToken string) ApiGetVolumeRequest { r.nextToken = &nextToken return r } -func (r ApiGetVolumeRequest) Execute() (CSIVolume, *_nethttp.Response, error) { +func (r ApiGetVolumeRequest) Execute() (*CSIVolume, *http.Response, error) { return r.ApiService.GetVolumeExecute(r) } /* - * GetVolume Method for GetVolume - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param volumeId Volume unique identifier. - * @return ApiGetVolumeRequest - */ -func (a *VolumesApiService) GetVolume(ctx _context.Context, volumeId string) ApiGetVolumeRequest { +GetVolume Method for GetVolume + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param volumeId Volume unique identifier. + @return ApiGetVolumeRequest +*/ +func (a *VolumesApiService) GetVolume(ctx context.Context, volumeId string) ApiGetVolumeRequest { return ApiGetVolumeRequest{ ApiService: a, ctx: ctx, @@ -1094,31 +1165,27 @@ func (a *VolumesApiService) GetVolume(ctx _context.Context, volumeId string) Api } } -/* - * Execute executes the request - * @return CSIVolume - */ -func (a *VolumesApiService) GetVolumeExecute(r ApiGetVolumeRequest) (CSIVolume, *_nethttp.Response, error) { +// Execute executes the request +// @return CSIVolume +func (a *VolumesApiService) GetVolumeExecute(r ApiGetVolumeRequest) (*CSIVolume, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CSIVolume + formFiles []formFile + localVarReturnValue *CSIVolume ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.GetVolume") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volume/csi/{volumeId}" - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterToString(r.volumeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1178,7 +1245,7 @@ func (a *VolumesApiService) GetVolumeExecute(r ApiGetVolumeRequest) (CSIVolume, } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1188,15 +1255,15 @@ func (a *VolumesApiService) GetVolumeExecute(r ApiGetVolumeRequest) (CSIVolume, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1205,7 +1272,7 @@ func (a *VolumesApiService) GetVolumeExecute(r ApiGetVolumeRequest) (CSIVolume, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1216,7 +1283,7 @@ func (a *VolumesApiService) GetVolumeExecute(r ApiGetVolumeRequest) (CSIVolume, } type ApiGetVolumesRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService region *string namespace *string @@ -1232,95 +1299,115 @@ type ApiGetVolumesRequest struct { type_ *string } +// Filters results based on the specified region. func (r ApiGetVolumesRequest) Region(region string) ApiGetVolumesRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiGetVolumesRequest) Namespace(namespace string) ApiGetVolumesRequest { r.namespace = &namespace return r } + +// If set, wait until query exceeds given index. Must be provided with WaitParam. func (r ApiGetVolumesRequest) Index(index int32) ApiGetVolumesRequest { r.index = &index return r } + +// Provided with IndexParam to wait for change. func (r ApiGetVolumesRequest) Wait(wait string) ApiGetVolumesRequest { r.wait = &wait return r } + +// If present, results will include stale reads. func (r ApiGetVolumesRequest) Stale(stale string) ApiGetVolumesRequest { r.stale = &stale return r } + +// Constrains results to jobs that start with the defined prefix func (r ApiGetVolumesRequest) Prefix(prefix string) ApiGetVolumesRequest { r.prefix = &prefix return r } + +// A Nomad ACL token. func (r ApiGetVolumesRequest) XNomadToken(xNomadToken string) ApiGetVolumesRequest { r.xNomadToken = &xNomadToken return r } + +// Maximum number of results to return. func (r ApiGetVolumesRequest) PerPage(perPage int32) ApiGetVolumesRequest { r.perPage = &perPage return r } + +// Indicates where to start paging for queries that support pagination. func (r ApiGetVolumesRequest) NextToken(nextToken string) ApiGetVolumesRequest { r.nextToken = &nextToken return r } + +// Filters volume lists by node ID. func (r ApiGetVolumesRequest) NodeId(nodeId string) ApiGetVolumesRequest { r.nodeId = &nodeId return r } + +// Filters volume lists by plugin ID. func (r ApiGetVolumesRequest) PluginId(pluginId string) ApiGetVolumesRequest { r.pluginId = &pluginId return r } + +// Filters volume lists to a specific type. func (r ApiGetVolumesRequest) Type_(type_ string) ApiGetVolumesRequest { r.type_ = &type_ return r } -func (r ApiGetVolumesRequest) Execute() ([]CSIVolumeListStub, *_nethttp.Response, error) { +func (r ApiGetVolumesRequest) Execute() ([]CSIVolumeListStub, *http.Response, error) { return r.ApiService.GetVolumesExecute(r) } /* - * GetVolumes Method for GetVolumes - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetVolumesRequest - */ -func (a *VolumesApiService) GetVolumes(ctx _context.Context) ApiGetVolumesRequest { +GetVolumes Method for GetVolumes + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetVolumesRequest +*/ +func (a *VolumesApiService) GetVolumes(ctx context.Context) ApiGetVolumesRequest { return ApiGetVolumesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return []CSIVolumeListStub - */ -func (a *VolumesApiService) GetVolumesExecute(r ApiGetVolumesRequest) ([]CSIVolumeListStub, *_nethttp.Response, error) { +// Execute executes the request +// @return []CSIVolumeListStub +func (a *VolumesApiService) GetVolumesExecute(r ApiGetVolumesRequest) ([]CSIVolumeListStub, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []CSIVolumeListStub ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.GetVolumes") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volumes" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.region != nil { localVarQueryParams.Add("region", parameterToString(*r.region, "")) @@ -1389,7 +1476,7 @@ func (a *VolumesApiService) GetVolumesExecute(r ApiGetVolumesRequest) ([]CSIVolu } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1399,15 +1486,15 @@ func (a *VolumesApiService) GetVolumesExecute(r ApiGetVolumesRequest) ([]CSIVolu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1416,7 +1503,7 @@ func (a *VolumesApiService) GetVolumesExecute(r ApiGetVolumesRequest) ([]CSIVolu err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1427,7 +1514,7 @@ func (a *VolumesApiService) GetVolumesExecute(r ApiGetVolumesRequest) ([]CSIVolu } type ApiPostSnapshotRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService cSISnapshotCreateRequest *CSISnapshotCreateRequest region *string @@ -1440,63 +1527,68 @@ func (r ApiPostSnapshotRequest) CSISnapshotCreateRequest(cSISnapshotCreateReques r.cSISnapshotCreateRequest = &cSISnapshotCreateRequest return r } + +// Filters results based on the specified region. func (r ApiPostSnapshotRequest) Region(region string) ApiPostSnapshotRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostSnapshotRequest) Namespace(namespace string) ApiPostSnapshotRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostSnapshotRequest) XNomadToken(xNomadToken string) ApiPostSnapshotRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostSnapshotRequest) IdempotencyToken(idempotencyToken string) ApiPostSnapshotRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostSnapshotRequest) Execute() (CSISnapshotCreateResponse, *_nethttp.Response, error) { +func (r ApiPostSnapshotRequest) Execute() (*CSISnapshotCreateResponse, *http.Response, error) { return r.ApiService.PostSnapshotExecute(r) } /* - * PostSnapshot Method for PostSnapshot - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostSnapshotRequest - */ -func (a *VolumesApiService) PostSnapshot(ctx _context.Context) ApiPostSnapshotRequest { +PostSnapshot Method for PostSnapshot + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostSnapshotRequest +*/ +func (a *VolumesApiService) PostSnapshot(ctx context.Context) ApiPostSnapshotRequest { return ApiPostSnapshotRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return CSISnapshotCreateResponse - */ -func (a *VolumesApiService) PostSnapshotExecute(r ApiPostSnapshotRequest) (CSISnapshotCreateResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return CSISnapshotCreateResponse +func (a *VolumesApiService) PostSnapshotExecute(r ApiPostSnapshotRequest) (*CSISnapshotCreateResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CSISnapshotCreateResponse + formFiles []formFile + localVarReturnValue *CSISnapshotCreateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.PostSnapshot") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volumes/snapshot" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.cSISnapshotCreateRequest == nil { return localVarReturnValue, nil, reportError("cSISnapshotCreateRequest is required and must be specified") } @@ -1546,7 +1638,7 @@ func (a *VolumesApiService) PostSnapshotExecute(r ApiPostSnapshotRequest) (CSISn } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1556,15 +1648,15 @@ func (a *VolumesApiService) PostSnapshotExecute(r ApiPostSnapshotRequest) (CSISn return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1573,7 +1665,7 @@ func (a *VolumesApiService) PostSnapshotExecute(r ApiPostSnapshotRequest) (CSISn err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1584,7 +1676,7 @@ func (a *VolumesApiService) PostSnapshotExecute(r ApiPostSnapshotRequest) (CSISn } type ApiPostVolumeRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService cSIVolumeRegisterRequest *CSIVolumeRegisterRequest region *string @@ -1597,61 +1689,66 @@ func (r ApiPostVolumeRequest) CSIVolumeRegisterRequest(cSIVolumeRegisterRequest r.cSIVolumeRegisterRequest = &cSIVolumeRegisterRequest return r } + +// Filters results based on the specified region. func (r ApiPostVolumeRequest) Region(region string) ApiPostVolumeRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostVolumeRequest) Namespace(namespace string) ApiPostVolumeRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostVolumeRequest) XNomadToken(xNomadToken string) ApiPostVolumeRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostVolumeRequest) IdempotencyToken(idempotencyToken string) ApiPostVolumeRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostVolumeRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPostVolumeRequest) Execute() (*http.Response, error) { return r.ApiService.PostVolumeExecute(r) } /* - * PostVolume Method for PostVolume - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPostVolumeRequest - */ -func (a *VolumesApiService) PostVolume(ctx _context.Context) ApiPostVolumeRequest { +PostVolume Method for PostVolume + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostVolumeRequest +*/ +func (a *VolumesApiService) PostVolume(ctx context.Context) ApiPostVolumeRequest { return ApiPostVolumeRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *VolumesApiService) PostVolumeExecute(r ApiPostVolumeRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *VolumesApiService) PostVolumeExecute(r ApiPostVolumeRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.PostVolume") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volumes" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.cSIVolumeRegisterRequest == nil { return nil, reportError("cSIVolumeRegisterRequest is required and must be specified") } @@ -1701,7 +1798,7 @@ func (a *VolumesApiService) PostVolumeExecute(r ApiPostVolumeRequest) (*_nethttp } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1711,15 +1808,15 @@ func (a *VolumesApiService) PostVolumeExecute(r ApiPostVolumeRequest) (*_nethttp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1730,7 +1827,7 @@ func (a *VolumesApiService) PostVolumeExecute(r ApiPostVolumeRequest) (*_nethttp } type ApiPostVolumeRegistrationRequest struct { - ctx _context.Context + ctx context.Context ApiService *VolumesApiService volumeId string cSIVolumeRegisterRequest *CSIVolumeRegisterRequest @@ -1744,34 +1841,43 @@ func (r ApiPostVolumeRegistrationRequest) CSIVolumeRegisterRequest(cSIVolumeRegi r.cSIVolumeRegisterRequest = &cSIVolumeRegisterRequest return r } + +// Filters results based on the specified region. func (r ApiPostVolumeRegistrationRequest) Region(region string) ApiPostVolumeRegistrationRequest { r.region = ®ion return r } + +// Filters results based on the specified namespace. func (r ApiPostVolumeRegistrationRequest) Namespace(namespace string) ApiPostVolumeRegistrationRequest { r.namespace = &namespace return r } + +// A Nomad ACL token. func (r ApiPostVolumeRegistrationRequest) XNomadToken(xNomadToken string) ApiPostVolumeRegistrationRequest { r.xNomadToken = &xNomadToken return r } + +// Can be used to ensure operations are only run once. func (r ApiPostVolumeRegistrationRequest) IdempotencyToken(idempotencyToken string) ApiPostVolumeRegistrationRequest { r.idempotencyToken = &idempotencyToken return r } -func (r ApiPostVolumeRegistrationRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPostVolumeRegistrationRequest) Execute() (*http.Response, error) { return r.ApiService.PostVolumeRegistrationExecute(r) } /* - * PostVolumeRegistration Method for PostVolumeRegistration - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param volumeId Volume unique identifier. - * @return ApiPostVolumeRegistrationRequest - */ -func (a *VolumesApiService) PostVolumeRegistration(ctx _context.Context, volumeId string) ApiPostVolumeRegistrationRequest { +PostVolumeRegistration Method for PostVolumeRegistration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param volumeId Volume unique identifier. + @return ApiPostVolumeRegistrationRequest +*/ +func (a *VolumesApiService) PostVolumeRegistration(ctx context.Context, volumeId string) ApiPostVolumeRegistrationRequest { return ApiPostVolumeRegistrationRequest{ ApiService: a, ctx: ctx, @@ -1779,29 +1885,25 @@ func (a *VolumesApiService) PostVolumeRegistration(ctx _context.Context, volumeI } } -/* - * Execute executes the request - */ -func (a *VolumesApiService) PostVolumeRegistrationExecute(r ApiPostVolumeRegistrationRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *VolumesApiService) PostVolumeRegistrationExecute(r ApiPostVolumeRegistrationRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.PostVolumeRegistration") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/volume/csi/{volumeId}" - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterToString(r.volumeId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.cSIVolumeRegisterRequest == nil { return nil, reportError("cSIVolumeRegisterRequest is required and must be specified") } @@ -1851,7 +1953,7 @@ func (a *VolumesApiService) PostVolumeRegistrationExecute(r ApiPostVolumeRegistr } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1861,15 +1963,15 @@ func (a *VolumesApiService) PostVolumeRegistrationExecute(r ApiPostVolumeRegistr return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/clients/go/v1/client.go b/clients/go/v1/client.go index 6fa3ac69..873e8fbd 100644 --- a/clients/go/v1/client.go +++ b/clients/go/v1/client.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -238,6 +238,12 @@ func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -246,9 +252,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -267,7 +271,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -286,16 +290,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } @@ -358,7 +363,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } @@ -415,6 +420,9 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = (*f).Write(b) + if err != nil { + return + } _, err = (*f).Seek(0, io.SeekStart) return } @@ -463,6 +471,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { diff --git a/clients/go/v1/configuration.go b/clients/go/v1/configuration.go index 7e9c60bf..6e64c75b 100644 --- a/clients/go/v1/configuration.go +++ b/clients/go/v1/configuration.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/docs/ACLApi.md b/clients/go/v1/docs/ACLApi.md index 8ddf9775..e6b1c740 100644 --- a/clients/go/v1/docs/ACLApi.md +++ b/clients/go/v1/docs/ACLApi.md @@ -45,8 +45,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.DeleteACLPolicy(context.Background(), policyName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.DeleteACLPolicy(context.Background(), policyName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.DeleteACLPolicy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -119,8 +119,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.DeleteACLToken(context.Background(), tokenAccessor).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.DeleteACLToken(context.Background(), tokenAccessor).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.DeleteACLToken``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -197,8 +197,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.GetACLPolicies(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.GetACLPolicies(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.GetACLPolicies``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -278,8 +278,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.GetACLPolicy(context.Background(), policyName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.GetACLPolicy(context.Background(), policyName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.GetACLPolicy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -364,8 +364,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.GetACLToken(context.Background(), tokenAccessor).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.GetACLToken(context.Background(), tokenAccessor).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.GetACLToken``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -449,8 +449,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.GetACLTokenSelf(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.GetACLTokenSelf(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.GetACLTokenSelf``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -529,8 +529,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.GetACLTokens(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.GetACLTokens(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.GetACLTokens``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -604,8 +604,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.PostACLBootstrap(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.PostACLBootstrap(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.PostACLBootstrap``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -676,8 +676,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.PostACLPolicy(context.Background(), policyName).ACLPolicy(aCLPolicy).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.PostACLPolicy(context.Background(), policyName).ACLPolicy(aCLPolicy).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.PostACLPolicy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -752,8 +752,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.PostACLToken(context.Background(), tokenAccessor).ACLToken(aCLToken).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.PostACLToken(context.Background(), tokenAccessor).ACLToken(aCLToken).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.PostACLToken``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -828,8 +828,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.PostACLTokenOnetime(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.PostACLTokenOnetime(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.PostACLTokenOnetime``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -899,8 +899,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ACLApi.PostACLTokenOnetimeExchange(context.Background()).OneTimeTokenExchangeRequest(oneTimeTokenExchangeRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ACLApi.PostACLTokenOnetimeExchange(context.Background()).OneTimeTokenExchangeRequest(oneTimeTokenExchangeRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ACLApi.PostACLTokenOnetimeExchange``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/ACLToken.md b/clients/go/v1/docs/ACLToken.md index b9e399aa..df74d798 100644 --- a/clients/go/v1/docs/ACLToken.md +++ b/clients/go/v1/docs/ACLToken.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AccessorID** | Pointer to **string** | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] -**CreateTime** | Pointer to **time.Time** | | [optional] +**CreateTime** | Pointer to **NullableTime** | | [optional] **Global** | Pointer to **bool** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **Name** | Pointer to **string** | | [optional] @@ -108,6 +108,16 @@ SetCreateTime sets CreateTime field to given value. HasCreateTime returns a boolean if a field has been set. +### SetCreateTimeNil + +`func (o *ACLToken) SetCreateTimeNil(b bool)` + + SetCreateTimeNil sets the value for CreateTime to be an explicit nil + +### UnsetCreateTime +`func (o *ACLToken) UnsetCreateTime()` + +UnsetCreateTime ensures that no value is present for CreateTime, not even an explicit nil ### GetGlobal `func (o *ACLToken) GetGlobal() bool` diff --git a/clients/go/v1/docs/ACLTokenListStub.md b/clients/go/v1/docs/ACLTokenListStub.md index 22e61419..1c2a06ec 100644 --- a/clients/go/v1/docs/ACLTokenListStub.md +++ b/clients/go/v1/docs/ACLTokenListStub.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AccessorID** | Pointer to **string** | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] -**CreateTime** | Pointer to **time.Time** | | [optional] +**CreateTime** | Pointer to **NullableTime** | | [optional] **Global** | Pointer to **bool** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **Name** | Pointer to **string** | | [optional] @@ -107,6 +107,16 @@ SetCreateTime sets CreateTime field to given value. HasCreateTime returns a boolean if a field has been set. +### SetCreateTimeNil + +`func (o *ACLTokenListStub) SetCreateTimeNil(b bool)` + + SetCreateTimeNil sets the value for CreateTime to be an explicit nil + +### UnsetCreateTime +`func (o *ACLTokenListStub) UnsetCreateTime()` + +UnsetCreateTime ensures that no value is present for CreateTime, not even an explicit nil ### GetGlobal `func (o *ACLTokenListStub) GetGlobal() bool` diff --git a/clients/go/v1/docs/AllocDeploymentStatus.md b/clients/go/v1/docs/AllocDeploymentStatus.md index 05d51c88..bea3d12e 100644 --- a/clients/go/v1/docs/AllocDeploymentStatus.md +++ b/clients/go/v1/docs/AllocDeploymentStatus.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **Canary** | Pointer to **bool** | | [optional] **Healthy** | Pointer to **bool** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**Timestamp** | Pointer to **NullableTime** | | [optional] ## Methods @@ -128,6 +128,16 @@ SetTimestamp sets Timestamp field to given value. HasTimestamp returns a boolean if a field has been set. +### SetTimestampNil + +`func (o *AllocDeploymentStatus) SetTimestampNil(b bool)` + + SetTimestampNil sets the value for Timestamp to be an explicit nil + +### UnsetTimestamp +`func (o *AllocDeploymentStatus) UnsetTimestamp()` + +UnsetTimestamp ensures that no value is present for Timestamp, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/AllocatedResources.md b/clients/go/v1/docs/AllocatedResources.md index 456e0a33..3647cb16 100644 --- a/clients/go/v1/docs/AllocatedResources.md +++ b/clients/go/v1/docs/AllocatedResources.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Shared** | Pointer to [**AllocatedSharedResources**](AllocatedSharedResources.md) | | [optional] +**Shared** | Pointer to [**NullableAllocatedSharedResources**](AllocatedSharedResources.md) | | [optional] **Tasks** | Pointer to [**map[string]AllocatedTaskResources**](AllocatedTaskResources.md) | | [optional] ## Methods @@ -51,6 +51,16 @@ SetShared sets Shared field to given value. HasShared returns a boolean if a field has been set. +### SetSharedNil + +`func (o *AllocatedResources) SetSharedNil(b bool)` + + SetSharedNil sets the value for Shared to be an explicit nil + +### UnsetShared +`func (o *AllocatedResources) UnsetShared()` + +UnsetShared ensures that no value is present for Shared, not even an explicit nil ### GetTasks `func (o *AllocatedResources) GetTasks() map[string]AllocatedTaskResources` diff --git a/clients/go/v1/docs/AllocatedTaskResources.md b/clients/go/v1/docs/AllocatedTaskResources.md index 460526cf..d2338bf4 100644 --- a/clients/go/v1/docs/AllocatedTaskResources.md +++ b/clients/go/v1/docs/AllocatedTaskResources.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cpu** | Pointer to [**AllocatedCpuResources**](AllocatedCpuResources.md) | | [optional] +**Cpu** | Pointer to [**NullableAllocatedCpuResources**](AllocatedCpuResources.md) | | [optional] **Devices** | Pointer to [**[]AllocatedDeviceResource**](AllocatedDeviceResource.md) | | [optional] -**Memory** | Pointer to [**AllocatedMemoryResources**](AllocatedMemoryResources.md) | | [optional] +**Memory** | Pointer to [**NullableAllocatedMemoryResources**](AllocatedMemoryResources.md) | | [optional] **Networks** | Pointer to [**[]NetworkResource**](NetworkResource.md) | | [optional] ## Methods @@ -53,6 +53,16 @@ SetCpu sets Cpu field to given value. HasCpu returns a boolean if a field has been set. +### SetCpuNil + +`func (o *AllocatedTaskResources) SetCpuNil(b bool)` + + SetCpuNil sets the value for Cpu to be an explicit nil + +### UnsetCpu +`func (o *AllocatedTaskResources) UnsetCpu()` + +UnsetCpu ensures that no value is present for Cpu, not even an explicit nil ### GetDevices `func (o *AllocatedTaskResources) GetDevices() []AllocatedDeviceResource` @@ -103,6 +113,16 @@ SetMemory sets Memory field to given value. HasMemory returns a boolean if a field has been set. +### SetMemoryNil + +`func (o *AllocatedTaskResources) SetMemoryNil(b bool)` + + SetMemoryNil sets the value for Memory to be an explicit nil + +### UnsetMemory +`func (o *AllocatedTaskResources) UnsetMemory()` + +UnsetMemory ensures that no value is present for Memory, not even an explicit nil ### GetNetworks `func (o *AllocatedTaskResources) GetNetworks() []NetworkResource` diff --git a/clients/go/v1/docs/Allocation.md b/clients/go/v1/docs/Allocation.md index 57a1a4e7..2a373f31 100644 --- a/clients/go/v1/docs/Allocation.md +++ b/clients/go/v1/docs/Allocation.md @@ -5,22 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AllocModifyIndex** | Pointer to **int32** | | [optional] -**AllocatedResources** | Pointer to [**AllocatedResources**](AllocatedResources.md) | | [optional] +**AllocatedResources** | Pointer to [**NullableAllocatedResources**](AllocatedResources.md) | | [optional] **ClientDescription** | Pointer to **string** | | [optional] **ClientStatus** | Pointer to **string** | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] **CreateTime** | Pointer to **int64** | | [optional] **DeploymentID** | Pointer to **string** | | [optional] -**DeploymentStatus** | Pointer to [**AllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] +**DeploymentStatus** | Pointer to [**NullableAllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] **DesiredDescription** | Pointer to **string** | | [optional] **DesiredStatus** | Pointer to **string** | | [optional] **DesiredTransition** | Pointer to [**DesiredTransition**](DesiredTransition.md) | | [optional] **EvalID** | Pointer to **string** | | [optional] **FollowupEvalID** | Pointer to **string** | | [optional] **ID** | Pointer to **string** | | [optional] -**Job** | Pointer to [**Job**](Job.md) | | [optional] +**Job** | Pointer to [**NullableJob**](Job.md) | | [optional] **JobID** | Pointer to **string** | | [optional] -**Metrics** | Pointer to [**AllocationMetric**](AllocationMetric.md) | | [optional] +**Metrics** | Pointer to [**NullableAllocationMetric**](AllocationMetric.md) | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **ModifyTime** | Pointer to **int64** | | [optional] **Name** | Pointer to **string** | | [optional] @@ -31,8 +31,8 @@ Name | Type | Description | Notes **PreemptedAllocations** | Pointer to **[]string** | | [optional] **PreemptedByAllocation** | Pointer to **string** | | [optional] **PreviousAllocation** | Pointer to **string** | | [optional] -**RescheduleTracker** | Pointer to [**RescheduleTracker**](RescheduleTracker.md) | | [optional] -**Resources** | Pointer to [**Resources**](Resources.md) | | [optional] +**RescheduleTracker** | Pointer to [**NullableRescheduleTracker**](RescheduleTracker.md) | | [optional] +**Resources** | Pointer to [**NullableResources**](Resources.md) | | [optional] **Services** | Pointer to **map[string]string** | | [optional] **TaskGroup** | Pointer to **string** | | [optional] **TaskResources** | Pointer to [**map[string]Resources**](Resources.md) | | [optional] @@ -107,6 +107,16 @@ SetAllocatedResources sets AllocatedResources field to given value. HasAllocatedResources returns a boolean if a field has been set. +### SetAllocatedResourcesNil + +`func (o *Allocation) SetAllocatedResourcesNil(b bool)` + + SetAllocatedResourcesNil sets the value for AllocatedResources to be an explicit nil + +### UnsetAllocatedResources +`func (o *Allocation) UnsetAllocatedResources()` + +UnsetAllocatedResources ensures that no value is present for AllocatedResources, not even an explicit nil ### GetClientDescription `func (o *Allocation) GetClientDescription() string` @@ -257,6 +267,16 @@ SetDeploymentStatus sets DeploymentStatus field to given value. HasDeploymentStatus returns a boolean if a field has been set. +### SetDeploymentStatusNil + +`func (o *Allocation) SetDeploymentStatusNil(b bool)` + + SetDeploymentStatusNil sets the value for DeploymentStatus to be an explicit nil + +### UnsetDeploymentStatus +`func (o *Allocation) UnsetDeploymentStatus()` + +UnsetDeploymentStatus ensures that no value is present for DeploymentStatus, not even an explicit nil ### GetDesiredDescription `func (o *Allocation) GetDesiredDescription() string` @@ -432,6 +452,16 @@ SetJob sets Job field to given value. HasJob returns a boolean if a field has been set. +### SetJobNil + +`func (o *Allocation) SetJobNil(b bool)` + + SetJobNil sets the value for Job to be an explicit nil + +### UnsetJob +`func (o *Allocation) UnsetJob()` + +UnsetJob ensures that no value is present for Job, not even an explicit nil ### GetJobID `func (o *Allocation) GetJobID() string` @@ -482,6 +512,16 @@ SetMetrics sets Metrics field to given value. HasMetrics returns a boolean if a field has been set. +### SetMetricsNil + +`func (o *Allocation) SetMetricsNil(b bool)` + + SetMetricsNil sets the value for Metrics to be an explicit nil + +### UnsetMetrics +`func (o *Allocation) UnsetMetrics()` + +UnsetMetrics ensures that no value is present for Metrics, not even an explicit nil ### GetModifyIndex `func (o *Allocation) GetModifyIndex() int32` @@ -757,6 +797,16 @@ SetRescheduleTracker sets RescheduleTracker field to given value. HasRescheduleTracker returns a boolean if a field has been set. +### SetRescheduleTrackerNil + +`func (o *Allocation) SetRescheduleTrackerNil(b bool)` + + SetRescheduleTrackerNil sets the value for RescheduleTracker to be an explicit nil + +### UnsetRescheduleTracker +`func (o *Allocation) UnsetRescheduleTracker()` + +UnsetRescheduleTracker ensures that no value is present for RescheduleTracker, not even an explicit nil ### GetResources `func (o *Allocation) GetResources() Resources` @@ -782,6 +832,16 @@ SetResources sets Resources field to given value. HasResources returns a boolean if a field has been set. +### SetResourcesNil + +`func (o *Allocation) SetResourcesNil(b bool)` + + SetResourcesNil sets the value for Resources to be an explicit nil + +### UnsetResources +`func (o *Allocation) UnsetResources()` + +UnsetResources ensures that no value is present for Resources, not even an explicit nil ### GetServices `func (o *Allocation) GetServices() map[string]string` diff --git a/clients/go/v1/docs/AllocationListStub.md b/clients/go/v1/docs/AllocationListStub.md index 84fbc298..f1bc1d21 100644 --- a/clients/go/v1/docs/AllocationListStub.md +++ b/clients/go/v1/docs/AllocationListStub.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AllocatedResources** | Pointer to [**AllocatedResources**](AllocatedResources.md) | | [optional] +**AllocatedResources** | Pointer to [**NullableAllocatedResources**](AllocatedResources.md) | | [optional] **ClientDescription** | Pointer to **string** | | [optional] **ClientStatus** | Pointer to **string** | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] **CreateTime** | Pointer to **int64** | | [optional] -**DeploymentStatus** | Pointer to [**AllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] +**DeploymentStatus** | Pointer to [**NullableAllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] **DesiredDescription** | Pointer to **string** | | [optional] **DesiredStatus** | Pointer to **string** | | [optional] **EvalID** | Pointer to **string** | | [optional] @@ -26,7 +26,7 @@ Name | Type | Description | Notes **NodeName** | Pointer to **string** | | [optional] **PreemptedAllocations** | Pointer to **[]string** | | [optional] **PreemptedByAllocation** | Pointer to **string** | | [optional] -**RescheduleTracker** | Pointer to [**RescheduleTracker**](RescheduleTracker.md) | | [optional] +**RescheduleTracker** | Pointer to [**NullableRescheduleTracker**](RescheduleTracker.md) | | [optional] **TaskGroup** | Pointer to **string** | | [optional] **TaskStates** | Pointer to [**map[string]TaskState**](TaskState.md) | | [optional] @@ -74,6 +74,16 @@ SetAllocatedResources sets AllocatedResources field to given value. HasAllocatedResources returns a boolean if a field has been set. +### SetAllocatedResourcesNil + +`func (o *AllocationListStub) SetAllocatedResourcesNil(b bool)` + + SetAllocatedResourcesNil sets the value for AllocatedResources to be an explicit nil + +### UnsetAllocatedResources +`func (o *AllocationListStub) UnsetAllocatedResources()` + +UnsetAllocatedResources ensures that no value is present for AllocatedResources, not even an explicit nil ### GetClientDescription `func (o *AllocationListStub) GetClientDescription() string` @@ -199,6 +209,16 @@ SetDeploymentStatus sets DeploymentStatus field to given value. HasDeploymentStatus returns a boolean if a field has been set. +### SetDeploymentStatusNil + +`func (o *AllocationListStub) SetDeploymentStatusNil(b bool)` + + SetDeploymentStatusNil sets the value for DeploymentStatus to be an explicit nil + +### UnsetDeploymentStatus +`func (o *AllocationListStub) UnsetDeploymentStatus()` + +UnsetDeploymentStatus ensures that no value is present for DeploymentStatus, not even an explicit nil ### GetDesiredDescription `func (o *AllocationListStub) GetDesiredDescription() string` @@ -624,6 +644,16 @@ SetRescheduleTracker sets RescheduleTracker field to given value. HasRescheduleTracker returns a boolean if a field has been set. +### SetRescheduleTrackerNil + +`func (o *AllocationListStub) SetRescheduleTrackerNil(b bool)` + + SetRescheduleTrackerNil sets the value for RescheduleTracker to be an explicit nil + +### UnsetRescheduleTracker +`func (o *AllocationListStub) UnsetRescheduleTracker()` + +UnsetRescheduleTracker ensures that no value is present for RescheduleTracker, not even an explicit nil ### GetTaskGroup `func (o *AllocationListStub) GetTaskGroup() string` diff --git a/clients/go/v1/docs/AllocationsApi.md b/clients/go/v1/docs/AllocationsApi.md index 540a2981..c23dda55 100644 --- a/clients/go/v1/docs/AllocationsApi.md +++ b/clients/go/v1/docs/AllocationsApi.md @@ -42,8 +42,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AllocationsApi.GetAllocation(context.Background(), allocID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AllocationsApi.GetAllocation(context.Background(), allocID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AllocationsApi.GetAllocation``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -128,8 +128,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AllocationsApi.GetAllocationServices(context.Background(), allocID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AllocationsApi.GetAllocationServices(context.Background(), allocID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AllocationsApi.GetAllocationServices``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -215,8 +215,8 @@ func main() { taskStates := true // bool | Flag indicating whether to include task states in response. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AllocationsApi.GetAllocations(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Resources(resources).TaskStates(taskStates).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AllocationsApi.GetAllocations(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Resources(resources).TaskStates(taskStates).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AllocationsApi.GetAllocations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -299,8 +299,8 @@ func main() { noShutdownDelay := true // bool | Flag indicating whether to delay shutdown when requesting an allocation stop. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AllocationsApi.PostAllocationStop(context.Background(), allocID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).NoShutdownDelay(noShutdownDelay).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AllocationsApi.PostAllocationStop(context.Background(), allocID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).NoShutdownDelay(noShutdownDelay).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AllocationsApi.PostAllocationStop``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/CSIInfo.md b/clients/go/v1/docs/CSIInfo.md index c1bee795..7034170f 100644 --- a/clients/go/v1/docs/CSIInfo.md +++ b/clients/go/v1/docs/CSIInfo.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AllocID** | Pointer to **string** | | [optional] -**ControllerInfo** | Pointer to [**CSIControllerInfo**](CSIControllerInfo.md) | | [optional] +**ControllerInfo** | Pointer to [**NullableCSIControllerInfo**](CSIControllerInfo.md) | | [optional] **HealthDescription** | Pointer to **string** | | [optional] **Healthy** | Pointer to **bool** | | [optional] -**NodeInfo** | Pointer to [**CSINodeInfo**](CSINodeInfo.md) | | [optional] +**NodeInfo** | Pointer to [**NullableCSINodeInfo**](CSINodeInfo.md) | | [optional] **PluginID** | Pointer to **string** | | [optional] **RequiresControllerPlugin** | Pointer to **bool** | | [optional] **RequiresTopologies** | Pointer to **bool** | | [optional] -**UpdateTime** | Pointer to **time.Time** | | [optional] +**UpdateTime** | Pointer to **NullableTime** | | [optional] ## Methods @@ -83,6 +83,16 @@ SetControllerInfo sets ControllerInfo field to given value. HasControllerInfo returns a boolean if a field has been set. +### SetControllerInfoNil + +`func (o *CSIInfo) SetControllerInfoNil(b bool)` + + SetControllerInfoNil sets the value for ControllerInfo to be an explicit nil + +### UnsetControllerInfo +`func (o *CSIInfo) UnsetControllerInfo()` + +UnsetControllerInfo ensures that no value is present for ControllerInfo, not even an explicit nil ### GetHealthDescription `func (o *CSIInfo) GetHealthDescription() string` @@ -158,6 +168,16 @@ SetNodeInfo sets NodeInfo field to given value. HasNodeInfo returns a boolean if a field has been set. +### SetNodeInfoNil + +`func (o *CSIInfo) SetNodeInfoNil(b bool)` + + SetNodeInfoNil sets the value for NodeInfo to be an explicit nil + +### UnsetNodeInfo +`func (o *CSIInfo) UnsetNodeInfo()` + +UnsetNodeInfo ensures that no value is present for NodeInfo, not even an explicit nil ### GetPluginID `func (o *CSIInfo) GetPluginID() string` @@ -258,6 +278,16 @@ SetUpdateTime sets UpdateTime field to given value. HasUpdateTime returns a boolean if a field has been set. +### SetUpdateTimeNil + +`func (o *CSIInfo) SetUpdateTimeNil(b bool)` + + SetUpdateTimeNil sets the value for UpdateTime to be an explicit nil + +### UnsetUpdateTime +`func (o *CSIInfo) UnsetUpdateTime()` + +UnsetUpdateTime ensures that no value is present for UpdateTime, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/CSINodeInfo.md b/clients/go/v1/docs/CSINodeInfo.md index 9f438626..6b4c0afb 100644 --- a/clients/go/v1/docs/CSINodeInfo.md +++ b/clients/go/v1/docs/CSINodeInfo.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccessibleTopology** | Pointer to [**CSITopology**](CSITopology.md) | | [optional] +**AccessibleTopology** | Pointer to [**NullableCSITopology**](CSITopology.md) | | [optional] **ID** | Pointer to **string** | | [optional] **MaxVolumes** | Pointer to **int64** | | [optional] **RequiresNodeStageVolume** | Pointer to **bool** | | [optional] @@ -56,6 +56,16 @@ SetAccessibleTopology sets AccessibleTopology field to given value. HasAccessibleTopology returns a boolean if a field has been set. +### SetAccessibleTopologyNil + +`func (o *CSINodeInfo) SetAccessibleTopologyNil(b bool)` + + SetAccessibleTopologyNil sets the value for AccessibleTopology to be an explicit nil + +### UnsetAccessibleTopology +`func (o *CSINodeInfo) UnsetAccessibleTopology()` + +UnsetAccessibleTopology ensures that no value is present for AccessibleTopology, not even an explicit nil ### GetID `func (o *CSINodeInfo) GetID() string` diff --git a/clients/go/v1/docs/CSIVolume.md b/clients/go/v1/docs/CSIVolume.md index 42480150..11f55175 100644 --- a/clients/go/v1/docs/CSIVolume.md +++ b/clients/go/v1/docs/CSIVolume.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **ExternalID** | Pointer to **string** | | [optional] **ID** | Pointer to **string** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] -**MountOptions** | Pointer to [**CSIMountOptions**](CSIMountOptions.md) | | [optional] +**MountOptions** | Pointer to [**NullableCSIMountOptions**](CSIMountOptions.md) | | [optional] **Name** | Pointer to **string** | | [optional] **Namespace** | Pointer to **string** | | [optional] **NodesExpected** | Pointer to **int32** | | [optional] @@ -30,8 +30,8 @@ Name | Type | Description | Notes **RequestedCapabilities** | Pointer to [**[]CSIVolumeCapability**](CSIVolumeCapability.md) | | [optional] **RequestedCapacityMax** | Pointer to **int64** | | [optional] **RequestedCapacityMin** | Pointer to **int64** | | [optional] -**RequestedTopologies** | Pointer to [**CSITopologyRequest**](CSITopologyRequest.md) | | [optional] -**ResourceExhausted** | Pointer to **time.Time** | | [optional] +**RequestedTopologies** | Pointer to [**NullableCSITopologyRequest**](CSITopologyRequest.md) | | [optional] +**ResourceExhausted** | Pointer to **NullableTime** | | [optional] **Schedulable** | Pointer to **bool** | | [optional] **Secrets** | Pointer to **map[string]string** | | [optional] **SnapshotID** | Pointer to **string** | | [optional] @@ -407,6 +407,16 @@ SetMountOptions sets MountOptions field to given value. HasMountOptions returns a boolean if a field has been set. +### SetMountOptionsNil + +`func (o *CSIVolume) SetMountOptionsNil(b bool)` + + SetMountOptionsNil sets the value for MountOptions to be an explicit nil + +### UnsetMountOptions +`func (o *CSIVolume) UnsetMountOptions()` + +UnsetMountOptions ensures that no value is present for MountOptions, not even an explicit nil ### GetName `func (o *CSIVolume) GetName() string` @@ -732,6 +742,16 @@ SetRequestedTopologies sets RequestedTopologies field to given value. HasRequestedTopologies returns a boolean if a field has been set. +### SetRequestedTopologiesNil + +`func (o *CSIVolume) SetRequestedTopologiesNil(b bool)` + + SetRequestedTopologiesNil sets the value for RequestedTopologies to be an explicit nil + +### UnsetRequestedTopologies +`func (o *CSIVolume) UnsetRequestedTopologies()` + +UnsetRequestedTopologies ensures that no value is present for RequestedTopologies, not even an explicit nil ### GetResourceExhausted `func (o *CSIVolume) GetResourceExhausted() time.Time` @@ -757,6 +777,16 @@ SetResourceExhausted sets ResourceExhausted field to given value. HasResourceExhausted returns a boolean if a field has been set. +### SetResourceExhaustedNil + +`func (o *CSIVolume) SetResourceExhaustedNil(b bool)` + + SetResourceExhaustedNil sets the value for ResourceExhausted to be an explicit nil + +### UnsetResourceExhausted +`func (o *CSIVolume) UnsetResourceExhausted()` + +UnsetResourceExhausted ensures that no value is present for ResourceExhausted, not even an explicit nil ### GetSchedulable `func (o *CSIVolume) GetSchedulable() bool` diff --git a/clients/go/v1/docs/CSIVolumeListStub.md b/clients/go/v1/docs/CSIVolumeListStub.md index 1b7abd0b..998418d0 100644 --- a/clients/go/v1/docs/CSIVolumeListStub.md +++ b/clients/go/v1/docs/CSIVolumeListStub.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **NodesHealthy** | Pointer to **int32** | | [optional] **PluginID** | Pointer to **string** | | [optional] **Provider** | Pointer to **string** | | [optional] -**ResourceExhausted** | Pointer to **time.Time** | | [optional] +**ResourceExhausted** | Pointer to **NullableTime** | | [optional] **Schedulable** | Pointer to **bool** | | [optional] **Topologies** | Pointer to [**[]CSITopology**](CSITopology.md) | | [optional] @@ -442,6 +442,16 @@ SetResourceExhausted sets ResourceExhausted field to given value. HasResourceExhausted returns a boolean if a field has been set. +### SetResourceExhaustedNil + +`func (o *CSIVolumeListStub) SetResourceExhaustedNil(b bool)` + + SetResourceExhaustedNil sets the value for ResourceExhausted to be an explicit nil + +### UnsetResourceExhausted +`func (o *CSIVolumeListStub) UnsetResourceExhausted()` + +UnsetResourceExhausted ensures that no value is present for ResourceExhausted, not even an explicit nil ### GetSchedulable `func (o *CSIVolumeListStub) GetSchedulable() bool` diff --git a/clients/go/v1/docs/ConsulConnect.md b/clients/go/v1/docs/ConsulConnect.md index 2c214f35..c928ce36 100644 --- a/clients/go/v1/docs/ConsulConnect.md +++ b/clients/go/v1/docs/ConsulConnect.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Gateway** | Pointer to [**ConsulGateway**](ConsulGateway.md) | | [optional] **Native** | Pointer to **bool** | | [optional] -**SidecarService** | Pointer to [**ConsulSidecarService**](ConsulSidecarService.md) | | [optional] -**SidecarTask** | Pointer to [**SidecarTask**](SidecarTask.md) | | [optional] +**SidecarService** | Pointer to [**NullableConsulSidecarService**](ConsulSidecarService.md) | | [optional] +**SidecarTask** | Pointer to [**NullableSidecarTask**](SidecarTask.md) | | [optional] ## Methods @@ -103,6 +103,16 @@ SetSidecarService sets SidecarService field to given value. HasSidecarService returns a boolean if a field has been set. +### SetSidecarServiceNil + +`func (o *ConsulConnect) SetSidecarServiceNil(b bool)` + + SetSidecarServiceNil sets the value for SidecarService to be an explicit nil + +### UnsetSidecarService +`func (o *ConsulConnect) UnsetSidecarService()` + +UnsetSidecarService ensures that no value is present for SidecarService, not even an explicit nil ### GetSidecarTask `func (o *ConsulConnect) GetSidecarTask() SidecarTask` @@ -128,6 +138,16 @@ SetSidecarTask sets SidecarTask field to given value. HasSidecarTask returns a boolean if a field has been set. +### SetSidecarTaskNil + +`func (o *ConsulConnect) SetSidecarTaskNil(b bool)` + + SetSidecarTaskNil sets the value for SidecarTask to be an explicit nil + +### UnsetSidecarTask +`func (o *ConsulConnect) UnsetSidecarTask()` + +UnsetSidecarTask ensures that no value is present for SidecarTask, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/ConsulGateway.md b/clients/go/v1/docs/ConsulGateway.md index 6b594a2b..4e41566f 100644 --- a/clients/go/v1/docs/ConsulGateway.md +++ b/clients/go/v1/docs/ConsulGateway.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Ingress** | Pointer to [**ConsulIngressConfigEntry**](ConsulIngressConfigEntry.md) | | [optional] +**Ingress** | Pointer to [**NullableConsulIngressConfigEntry**](ConsulIngressConfigEntry.md) | | [optional] **Mesh** | Pointer to **interface{}** | | [optional] -**Proxy** | Pointer to [**ConsulGatewayProxy**](ConsulGatewayProxy.md) | | [optional] -**Terminating** | Pointer to [**ConsulTerminatingConfigEntry**](ConsulTerminatingConfigEntry.md) | | [optional] +**Proxy** | Pointer to [**NullableConsulGatewayProxy**](ConsulGatewayProxy.md) | | [optional] +**Terminating** | Pointer to [**NullableConsulTerminatingConfigEntry**](ConsulTerminatingConfigEntry.md) | | [optional] ## Methods @@ -53,6 +53,16 @@ SetIngress sets Ingress field to given value. HasIngress returns a boolean if a field has been set. +### SetIngressNil + +`func (o *ConsulGateway) SetIngressNil(b bool)` + + SetIngressNil sets the value for Ingress to be an explicit nil + +### UnsetIngress +`func (o *ConsulGateway) UnsetIngress()` + +UnsetIngress ensures that no value is present for Ingress, not even an explicit nil ### GetMesh `func (o *ConsulGateway) GetMesh() interface{}` @@ -113,6 +123,16 @@ SetProxy sets Proxy field to given value. HasProxy returns a boolean if a field has been set. +### SetProxyNil + +`func (o *ConsulGateway) SetProxyNil(b bool)` + + SetProxyNil sets the value for Proxy to be an explicit nil + +### UnsetProxy +`func (o *ConsulGateway) UnsetProxy()` + +UnsetProxy ensures that no value is present for Proxy, not even an explicit nil ### GetTerminating `func (o *ConsulGateway) GetTerminating() ConsulTerminatingConfigEntry` @@ -138,6 +158,16 @@ SetTerminating sets Terminating field to given value. HasTerminating returns a boolean if a field has been set. +### SetTerminatingNil + +`func (o *ConsulGateway) SetTerminatingNil(b bool)` + + SetTerminatingNil sets the value for Terminating to be an explicit nil + +### UnsetTerminating +`func (o *ConsulGateway) UnsetTerminating()` + +UnsetTerminating ensures that no value is present for Terminating, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/ConsulIngressConfigEntry.md b/clients/go/v1/docs/ConsulIngressConfigEntry.md index a87c252e..c598d15c 100644 --- a/clients/go/v1/docs/ConsulIngressConfigEntry.md +++ b/clients/go/v1/docs/ConsulIngressConfigEntry.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Listeners** | Pointer to [**[]ConsulIngressListener**](ConsulIngressListener.md) | | [optional] -**TLS** | Pointer to [**ConsulGatewayTLSConfig**](ConsulGatewayTLSConfig.md) | | [optional] +**TLS** | Pointer to [**NullableConsulGatewayTLSConfig**](ConsulGatewayTLSConfig.md) | | [optional] ## Methods @@ -76,6 +76,16 @@ SetTLS sets TLS field to given value. HasTLS returns a boolean if a field has been set. +### SetTLSNil + +`func (o *ConsulIngressConfigEntry) SetTLSNil(b bool)` + + SetTLSNil sets the value for TLS to be an explicit nil + +### UnsetTLS +`func (o *ConsulIngressConfigEntry) UnsetTLS()` + +UnsetTLS ensures that no value is present for TLS, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/ConsulProxy.md b/clients/go/v1/docs/ConsulProxy.md index 282aa1ad..57e5afbf 100644 --- a/clients/go/v1/docs/ConsulProxy.md +++ b/clients/go/v1/docs/ConsulProxy.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Config** | Pointer to **map[string]interface{}** | | [optional] -**ExposeConfig** | Pointer to [**ConsulExposeConfig**](ConsulExposeConfig.md) | | [optional] +**ExposeConfig** | Pointer to [**NullableConsulExposeConfig**](ConsulExposeConfig.md) | | [optional] **LocalServiceAddress** | Pointer to **string** | | [optional] **LocalServicePort** | Pointer to **int32** | | [optional] **Upstreams** | Pointer to [**[]ConsulUpstream**](ConsulUpstream.md) | | [optional] @@ -79,6 +79,16 @@ SetExposeConfig sets ExposeConfig field to given value. HasExposeConfig returns a boolean if a field has been set. +### SetExposeConfigNil + +`func (o *ConsulProxy) SetExposeConfigNil(b bool)` + + SetExposeConfigNil sets the value for ExposeConfig to be an explicit nil + +### UnsetExposeConfig +`func (o *ConsulProxy) UnsetExposeConfig()` + +UnsetExposeConfig ensures that no value is present for ExposeConfig, not even an explicit nil ### GetLocalServiceAddress `func (o *ConsulProxy) GetLocalServiceAddress() string` diff --git a/clients/go/v1/docs/ConsulSidecarService.md b/clients/go/v1/docs/ConsulSidecarService.md index 5526d737..bfa078d2 100644 --- a/clients/go/v1/docs/ConsulSidecarService.md +++ b/clients/go/v1/docs/ConsulSidecarService.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **DisableDefaultTCPCheck** | Pointer to **bool** | | [optional] **Port** | Pointer to **string** | | [optional] -**Proxy** | Pointer to [**ConsulProxy**](ConsulProxy.md) | | [optional] +**Proxy** | Pointer to [**NullableConsulProxy**](ConsulProxy.md) | | [optional] **Tags** | Pointer to **[]string** | | [optional] ## Methods @@ -103,6 +103,16 @@ SetProxy sets Proxy field to given value. HasProxy returns a boolean if a field has been set. +### SetProxyNil + +`func (o *ConsulSidecarService) SetProxyNil(b bool)` + + SetProxyNil sets the value for Proxy to be an explicit nil + +### UnsetProxy +`func (o *ConsulSidecarService) UnsetProxy()` + +UnsetProxy ensures that no value is present for Proxy, not even an explicit nil ### GetTags `func (o *ConsulSidecarService) GetTags() []string` diff --git a/clients/go/v1/docs/ConsulUpstream.md b/clients/go/v1/docs/ConsulUpstream.md index 84cf5ace..564ce5e6 100644 --- a/clients/go/v1/docs/ConsulUpstream.md +++ b/clients/go/v1/docs/ConsulUpstream.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **DestinationNamespace** | Pointer to **string** | | [optional] **LocalBindAddress** | Pointer to **string** | | [optional] **LocalBindPort** | Pointer to **int32** | | [optional] -**MeshGateway** | Pointer to [**ConsulMeshGateway**](ConsulMeshGateway.md) | | [optional] +**MeshGateway** | Pointer to [**NullableConsulMeshGateway**](ConsulMeshGateway.md) | | [optional] ## Methods @@ -180,6 +180,16 @@ SetMeshGateway sets MeshGateway field to given value. HasMeshGateway returns a boolean if a field has been set. +### SetMeshGatewayNil + +`func (o *ConsulUpstream) SetMeshGatewayNil(b bool)` + + SetMeshGatewayNil sets the value for MeshGateway to be an explicit nil + +### UnsetMeshGateway +`func (o *ConsulUpstream) UnsetMeshGateway()` + +UnsetMeshGateway ensures that no value is present for MeshGateway, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/DeploymentState.md b/clients/go/v1/docs/DeploymentState.md index 93dd3cbf..9290d4ef 100644 --- a/clients/go/v1/docs/DeploymentState.md +++ b/clients/go/v1/docs/DeploymentState.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **PlacedCanaries** | Pointer to **[]string** | | [optional] **ProgressDeadline** | Pointer to **int64** | | [optional] **Promoted** | Pointer to **bool** | | [optional] -**RequireProgressBy** | Pointer to **time.Time** | | [optional] +**RequireProgressBy** | Pointer to **NullableTime** | | [optional] **UnhealthyAllocs** | Pointer to **int32** | | [optional] ## Methods @@ -259,6 +259,16 @@ SetRequireProgressBy sets RequireProgressBy field to given value. HasRequireProgressBy returns a boolean if a field has been set. +### SetRequireProgressByNil + +`func (o *DeploymentState) SetRequireProgressByNil(b bool)` + + SetRequireProgressByNil sets the value for RequireProgressBy to be an explicit nil + +### UnsetRequireProgressBy +`func (o *DeploymentState) UnsetRequireProgressBy()` + +UnsetRequireProgressBy ensures that no value is present for RequireProgressBy, not even an explicit nil ### GetUnhealthyAllocs `func (o *DeploymentState) GetUnhealthyAllocs() int32` diff --git a/clients/go/v1/docs/DeploymentsApi.md b/clients/go/v1/docs/DeploymentsApi.md index 0c9f34d2..b50ca9d4 100644 --- a/clients/go/v1/docs/DeploymentsApi.md +++ b/clients/go/v1/docs/DeploymentsApi.md @@ -46,8 +46,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.GetDeployment(context.Background(), deploymentID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.GetDeployment(context.Background(), deploymentID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.GetDeployment``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -132,8 +132,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.GetDeploymentAllocations(context.Background(), deploymentID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.GetDeploymentAllocations(context.Background(), deploymentID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.GetDeploymentAllocations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -217,8 +217,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.GetDeployments(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.GetDeployments(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.GetDeployments``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -294,8 +294,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.PostDeploymentAllocationHealth(context.Background(), deploymentID).DeploymentAllocHealthRequest(deploymentAllocHealthRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.PostDeploymentAllocationHealth(context.Background(), deploymentID).DeploymentAllocHealthRequest(deploymentAllocHealthRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.PostDeploymentAllocationHealth``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -371,8 +371,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.PostDeploymentFail(context.Background(), deploymentID).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.PostDeploymentFail(context.Background(), deploymentID).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.PostDeploymentFail``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -448,8 +448,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.PostDeploymentPause(context.Background(), deploymentID).DeploymentPauseRequest(deploymentPauseRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.PostDeploymentPause(context.Background(), deploymentID).DeploymentPauseRequest(deploymentPauseRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.PostDeploymentPause``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -526,8 +526,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.PostDeploymentPromote(context.Background(), deploymentID).DeploymentPromoteRequest(deploymentPromoteRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.PostDeploymentPromote(context.Background(), deploymentID).DeploymentPromoteRequest(deploymentPromoteRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.PostDeploymentPromote``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -604,8 +604,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DeploymentsApi.PostDeploymentUnblock(context.Background(), deploymentID).DeploymentUnblockRequest(deploymentUnblockRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DeploymentsApi.PostDeploymentUnblock(context.Background(), deploymentID).DeploymentUnblockRequest(deploymentUnblockRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeploymentsApi.PostDeploymentUnblock``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/DrainMetadata.md b/clients/go/v1/docs/DrainMetadata.md index 3d8ac78f..2e32724c 100644 --- a/clients/go/v1/docs/DrainMetadata.md +++ b/clients/go/v1/docs/DrainMetadata.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AccessorID** | Pointer to **string** | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] -**StartedAt** | Pointer to **time.Time** | | [optional] +**StartedAt** | Pointer to **NullableTime** | | [optional] **Status** | Pointer to **string** | | [optional] -**UpdatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **NullableTime** | | [optional] ## Methods @@ -104,6 +104,16 @@ SetStartedAt sets StartedAt field to given value. HasStartedAt returns a boolean if a field has been set. +### SetStartedAtNil + +`func (o *DrainMetadata) SetStartedAtNil(b bool)` + + SetStartedAtNil sets the value for StartedAt to be an explicit nil + +### UnsetStartedAt +`func (o *DrainMetadata) UnsetStartedAt()` + +UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil ### GetStatus `func (o *DrainMetadata) GetStatus() string` @@ -154,6 +164,16 @@ SetUpdatedAt sets UpdatedAt field to given value. HasUpdatedAt returns a boolean if a field has been set. +### SetUpdatedAtNil + +`func (o *DrainMetadata) SetUpdatedAtNil(b bool)` + + SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil + +### UnsetUpdatedAt +`func (o *DrainMetadata) UnsetUpdatedAt()` + +UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/DrainStrategy.md b/clients/go/v1/docs/DrainStrategy.md index 765e65d3..0a5e4ab2 100644 --- a/clients/go/v1/docs/DrainStrategy.md +++ b/clients/go/v1/docs/DrainStrategy.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Deadline** | Pointer to **int64** | | [optional] -**ForceDeadline** | Pointer to **time.Time** | | [optional] +**ForceDeadline** | Pointer to **NullableTime** | | [optional] **IgnoreSystemJobs** | Pointer to **bool** | | [optional] -**StartedAt** | Pointer to **time.Time** | | [optional] +**StartedAt** | Pointer to **NullableTime** | | [optional] ## Methods @@ -78,6 +78,16 @@ SetForceDeadline sets ForceDeadline field to given value. HasForceDeadline returns a boolean if a field has been set. +### SetForceDeadlineNil + +`func (o *DrainStrategy) SetForceDeadlineNil(b bool)` + + SetForceDeadlineNil sets the value for ForceDeadline to be an explicit nil + +### UnsetForceDeadline +`func (o *DrainStrategy) UnsetForceDeadline()` + +UnsetForceDeadline ensures that no value is present for ForceDeadline, not even an explicit nil ### GetIgnoreSystemJobs `func (o *DrainStrategy) GetIgnoreSystemJobs() bool` @@ -128,6 +138,16 @@ SetStartedAt sets StartedAt field to given value. HasStartedAt returns a boolean if a field has been set. +### SetStartedAtNil + +`func (o *DrainStrategy) SetStartedAtNil(b bool)` + + SetStartedAtNil sets the value for StartedAt to be an explicit nil + +### UnsetStartedAt +`func (o *DrainStrategy) UnsetStartedAt()` + +UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/DriverInfo.md b/clients/go/v1/docs/DriverInfo.md index e26db6e3..e15592f9 100644 --- a/clients/go/v1/docs/DriverInfo.md +++ b/clients/go/v1/docs/DriverInfo.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **Detected** | Pointer to **bool** | | [optional] **HealthDescription** | Pointer to **string** | | [optional] **Healthy** | Pointer to **bool** | | [optional] -**UpdateTime** | Pointer to **time.Time** | | [optional] +**UpdateTime** | Pointer to **NullableTime** | | [optional] ## Methods @@ -154,6 +154,16 @@ SetUpdateTime sets UpdateTime field to given value. HasUpdateTime returns a boolean if a field has been set. +### SetUpdateTimeNil + +`func (o *DriverInfo) SetUpdateTimeNil(b bool)` + + SetUpdateTimeNil sets the value for UpdateTime to be an explicit nil + +### UnsetUpdateTime +`func (o *DriverInfo) UnsetUpdateTime()` + +UnsetUpdateTime ensures that no value is present for UpdateTime, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/EnterpriseApi.md b/clients/go/v1/docs/EnterpriseApi.md index 920156e1..e6374049 100644 --- a/clients/go/v1/docs/EnterpriseApi.md +++ b/clients/go/v1/docs/EnterpriseApi.md @@ -38,8 +38,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EnterpriseApi.CreateQuotaSpec(context.Background()).QuotaSpec(quotaSpec).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EnterpriseApi.CreateQuotaSpec(context.Background()).QuotaSpec(quotaSpec).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EnterpriseApi.CreateQuotaSpec``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -108,8 +108,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EnterpriseApi.DeleteQuotaSpec(context.Background(), specName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EnterpriseApi.DeleteQuotaSpec(context.Background(), specName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EnterpriseApi.DeleteQuotaSpec``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -187,8 +187,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EnterpriseApi.GetQuotaSpec(context.Background(), specName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EnterpriseApi.GetQuotaSpec(context.Background(), specName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EnterpriseApi.GetQuotaSpec``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -272,8 +272,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EnterpriseApi.GetQuotas(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EnterpriseApi.GetQuotas(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EnterpriseApi.GetQuotas``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -349,8 +349,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EnterpriseApi.PostQuotaSpec(context.Background(), specName).QuotaSpec(quotaSpec).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EnterpriseApi.PostQuotaSpec(context.Background(), specName).QuotaSpec(quotaSpec).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EnterpriseApi.PostQuotaSpec``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/Evaluation.md b/clients/go/v1/docs/Evaluation.md index cb4d4577..643be220 100644 --- a/clients/go/v1/docs/Evaluation.md +++ b/clients/go/v1/docs/Evaluation.md @@ -32,7 +32,7 @@ Name | Type | Description | Notes **TriggeredBy** | Pointer to **string** | | [optional] **Type** | Pointer to **string** | | [optional] **Wait** | Pointer to **int64** | | [optional] -**WaitUntil** | Pointer to **time.Time** | | [optional] +**WaitUntil** | Pointer to **NullableTime** | | [optional] ## Methods @@ -778,6 +778,16 @@ SetWaitUntil sets WaitUntil field to given value. HasWaitUntil returns a boolean if a field has been set. +### SetWaitUntilNil + +`func (o *Evaluation) SetWaitUntilNil(b bool)` + + SetWaitUntilNil sets the value for WaitUntil to be an explicit nil + +### UnsetWaitUntil +`func (o *Evaluation) UnsetWaitUntil()` + +UnsetWaitUntil ensures that no value is present for WaitUntil, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/EvaluationStub.md b/clients/go/v1/docs/EvaluationStub.md index e18d280b..93d37be3 100644 --- a/clients/go/v1/docs/EvaluationStub.md +++ b/clients/go/v1/docs/EvaluationStub.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **StatusDescription** | Pointer to **string** | | [optional] **TriggeredBy** | Pointer to **string** | | [optional] **Type** | Pointer to **string** | | [optional] -**WaitUntil** | Pointer to **time.Time** | | [optional] +**WaitUntil** | Pointer to **NullableTime** | | [optional] ## Methods @@ -492,6 +492,16 @@ SetWaitUntil sets WaitUntil field to given value. HasWaitUntil returns a boolean if a field has been set. +### SetWaitUntilNil + +`func (o *EvaluationStub) SetWaitUntilNil(b bool)` + + SetWaitUntilNil sets the value for WaitUntil to be an explicit nil + +### UnsetWaitUntil +`func (o *EvaluationStub) UnsetWaitUntil()` + +UnsetWaitUntil ensures that no value is present for WaitUntil, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/EvaluationsApi.md b/clients/go/v1/docs/EvaluationsApi.md index 229b0296..700942db 100644 --- a/clients/go/v1/docs/EvaluationsApi.md +++ b/clients/go/v1/docs/EvaluationsApi.md @@ -41,8 +41,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EvaluationsApi.GetEvaluation(context.Background(), evalID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EvaluationsApi.GetEvaluation(context.Background(), evalID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EvaluationsApi.GetEvaluation``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -127,8 +127,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EvaluationsApi.GetEvaluationAllocations(context.Background(), evalID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EvaluationsApi.GetEvaluationAllocations(context.Background(), evalID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EvaluationsApi.GetEvaluationAllocations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -212,8 +212,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EvaluationsApi.GetEvaluations(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EvaluationsApi.GetEvaluations(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EvaluationsApi.GetEvaluations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/Job.md b/clients/go/v1/docs/Job.md index 8746e016..e3becc20 100644 --- a/clients/go/v1/docs/Job.md +++ b/clients/go/v1/docs/Job.md @@ -18,11 +18,11 @@ Name | Type | Description | Notes **Meta** | Pointer to **map[string]string** | | [optional] **Migrate** | Pointer to [**MigrateStrategy**](MigrateStrategy.md) | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] -**Multiregion** | Pointer to [**Multiregion**](Multiregion.md) | | [optional] +**Multiregion** | Pointer to [**NullableMultiregion**](Multiregion.md) | | [optional] **Name** | Pointer to **string** | | [optional] **Namespace** | Pointer to **string** | | [optional] **NomadTokenID** | Pointer to **string** | | [optional] -**ParameterizedJob** | Pointer to [**ParameterizedJobConfig**](ParameterizedJobConfig.md) | | [optional] +**ParameterizedJob** | Pointer to [**NullableParameterizedJobConfig**](ParameterizedJobConfig.md) | | [optional] **ParentID** | Pointer to **string** | | [optional] **Payload** | Pointer to **string** | | [optional] **Periodic** | Pointer to [**PeriodicConfig**](PeriodicConfig.md) | | [optional] @@ -436,6 +436,16 @@ SetMultiregion sets Multiregion field to given value. HasMultiregion returns a boolean if a field has been set. +### SetMultiregionNil + +`func (o *Job) SetMultiregionNil(b bool)` + + SetMultiregionNil sets the value for Multiregion to be an explicit nil + +### UnsetMultiregion +`func (o *Job) UnsetMultiregion()` + +UnsetMultiregion ensures that no value is present for Multiregion, not even an explicit nil ### GetName `func (o *Job) GetName() string` @@ -536,6 +546,16 @@ SetParameterizedJob sets ParameterizedJob field to given value. HasParameterizedJob returns a boolean if a field has been set. +### SetParameterizedJobNil + +`func (o *Job) SetParameterizedJobNil(b bool)` + + SetParameterizedJobNil sets the value for ParameterizedJob to be an explicit nil + +### UnsetParameterizedJob +`func (o *Job) UnsetParameterizedJob()` + +UnsetParameterizedJob ensures that no value is present for ParameterizedJob, not even an explicit nil ### GetParentID `func (o *Job) GetParentID() string` diff --git a/clients/go/v1/docs/JobEvaluateRequest.md b/clients/go/v1/docs/JobEvaluateRequest.md index 4ea0bba9..f0481134 100644 --- a/clients/go/v1/docs/JobEvaluateRequest.md +++ b/clients/go/v1/docs/JobEvaluateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EvalOptions** | Pointer to [**EvalOptions**](EvalOptions.md) | | [optional] +**EvalOptions** | Pointer to [**NullableEvalOptions**](EvalOptions.md) | | [optional] **JobID** | Pointer to **string** | | [optional] **Namespace** | Pointer to **string** | | [optional] **Region** | Pointer to **string** | | [optional] @@ -54,6 +54,16 @@ SetEvalOptions sets EvalOptions field to given value. HasEvalOptions returns a boolean if a field has been set. +### SetEvalOptionsNil + +`func (o *JobEvaluateRequest) SetEvalOptionsNil(b bool)` + + SetEvalOptionsNil sets the value for EvalOptions to be an explicit nil + +### UnsetEvalOptions +`func (o *JobEvaluateRequest) UnsetEvalOptions()` + +UnsetEvalOptions ensures that no value is present for EvalOptions, not even an explicit nil ### GetJobID `func (o *JobEvaluateRequest) GetJobID() string` diff --git a/clients/go/v1/docs/JobListStub.md b/clients/go/v1/docs/JobListStub.md index b3174504..8c3cb579 100644 --- a/clients/go/v1/docs/JobListStub.md +++ b/clients/go/v1/docs/JobListStub.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **Datacenters** | Pointer to **[]string** | | [optional] **ID** | Pointer to **string** | | [optional] **JobModifyIndex** | Pointer to **int32** | | [optional] -**JobSummary** | Pointer to [**JobSummary**](JobSummary.md) | | [optional] +**JobSummary** | Pointer to [**NullableJobSummary**](JobSummary.md) | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **Name** | Pointer to **string** | | [optional] **Namespace** | Pointer to **string** | | [optional] @@ -166,6 +166,16 @@ SetJobSummary sets JobSummary field to given value. HasJobSummary returns a boolean if a field has been set. +### SetJobSummaryNil + +`func (o *JobListStub) SetJobSummaryNil(b bool)` + + SetJobSummaryNil sets the value for JobSummary to be an explicit nil + +### UnsetJobSummary +`func (o *JobListStub) UnsetJobSummary()` + +UnsetJobSummary ensures that no value is present for JobSummary, not even an explicit nil ### GetModifyIndex `func (o *JobListStub) GetModifyIndex() int32` diff --git a/clients/go/v1/docs/JobPlanRequest.md b/clients/go/v1/docs/JobPlanRequest.md index 6a56ba2c..7fe8d8b3 100644 --- a/clients/go/v1/docs/JobPlanRequest.md +++ b/clients/go/v1/docs/JobPlanRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Diff** | Pointer to **bool** | | [optional] -**Job** | Pointer to [**Job**](Job.md) | | [optional] +**Job** | Pointer to [**NullableJob**](Job.md) | | [optional] **Namespace** | Pointer to **string** | | [optional] **PolicyOverride** | Pointer to **bool** | | [optional] **Region** | Pointer to **string** | | [optional] @@ -80,6 +80,16 @@ SetJob sets Job field to given value. HasJob returns a boolean if a field has been set. +### SetJobNil + +`func (o *JobPlanRequest) SetJobNil(b bool)` + + SetJobNil sets the value for Job to be an explicit nil + +### UnsetJob +`func (o *JobPlanRequest) UnsetJob()` + +UnsetJob ensures that no value is present for Job, not even an explicit nil ### GetNamespace `func (o *JobPlanRequest) GetNamespace() string` diff --git a/clients/go/v1/docs/JobPlanResponse.md b/clients/go/v1/docs/JobPlanResponse.md index b622bd42..469929c6 100644 --- a/clients/go/v1/docs/JobPlanResponse.md +++ b/clients/go/v1/docs/JobPlanResponse.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Annotations** | Pointer to [**PlanAnnotations**](PlanAnnotations.md) | | [optional] +**Annotations** | Pointer to [**NullablePlanAnnotations**](PlanAnnotations.md) | | [optional] **CreatedEvals** | Pointer to [**[]Evaluation**](Evaluation.md) | | [optional] -**Diff** | Pointer to [**JobDiff**](JobDiff.md) | | [optional] +**Diff** | Pointer to [**NullableJobDiff**](JobDiff.md) | | [optional] **FailedTGAllocs** | Pointer to [**map[string]AllocationMetric**](AllocationMetric.md) | | [optional] **JobModifyIndex** | Pointer to **int32** | | [optional] -**NextPeriodicLaunch** | Pointer to **time.Time** | | [optional] +**NextPeriodicLaunch** | Pointer to **NullableTime** | | [optional] **Warnings** | Pointer to **string** | | [optional] ## Methods @@ -56,6 +56,16 @@ SetAnnotations sets Annotations field to given value. HasAnnotations returns a boolean if a field has been set. +### SetAnnotationsNil + +`func (o *JobPlanResponse) SetAnnotationsNil(b bool)` + + SetAnnotationsNil sets the value for Annotations to be an explicit nil + +### UnsetAnnotations +`func (o *JobPlanResponse) UnsetAnnotations()` + +UnsetAnnotations ensures that no value is present for Annotations, not even an explicit nil ### GetCreatedEvals `func (o *JobPlanResponse) GetCreatedEvals() []Evaluation` @@ -106,6 +116,16 @@ SetDiff sets Diff field to given value. HasDiff returns a boolean if a field has been set. +### SetDiffNil + +`func (o *JobPlanResponse) SetDiffNil(b bool)` + + SetDiffNil sets the value for Diff to be an explicit nil + +### UnsetDiff +`func (o *JobPlanResponse) UnsetDiff()` + +UnsetDiff ensures that no value is present for Diff, not even an explicit nil ### GetFailedTGAllocs `func (o *JobPlanResponse) GetFailedTGAllocs() map[string]AllocationMetric` @@ -181,6 +201,16 @@ SetNextPeriodicLaunch sets NextPeriodicLaunch field to given value. HasNextPeriodicLaunch returns a boolean if a field has been set. +### SetNextPeriodicLaunchNil + +`func (o *JobPlanResponse) SetNextPeriodicLaunchNil(b bool)` + + SetNextPeriodicLaunchNil sets the value for NextPeriodicLaunch to be an explicit nil + +### UnsetNextPeriodicLaunch +`func (o *JobPlanResponse) UnsetNextPeriodicLaunch()` + +UnsetNextPeriodicLaunch ensures that no value is present for NextPeriodicLaunch, not even an explicit nil ### GetWarnings `func (o *JobPlanResponse) GetWarnings() string` diff --git a/clients/go/v1/docs/JobRegisterRequest.md b/clients/go/v1/docs/JobRegisterRequest.md index 2a7ed33b..2b9ca7df 100644 --- a/clients/go/v1/docs/JobRegisterRequest.md +++ b/clients/go/v1/docs/JobRegisterRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnforceIndex** | Pointer to **bool** | | [optional] **EvalPriority** | Pointer to **int32** | | [optional] -**Job** | Pointer to [**Job**](Job.md) | | [optional] +**Job** | Pointer to [**NullableJob**](Job.md) | | [optional] **JobModifyIndex** | Pointer to **int32** | | [optional] **Namespace** | Pointer to **string** | | [optional] **PolicyOverride** | Pointer to **bool** | | [optional] @@ -108,6 +108,16 @@ SetJob sets Job field to given value. HasJob returns a boolean if a field has been set. +### SetJobNil + +`func (o *JobRegisterRequest) SetJobNil(b bool)` + + SetJobNil sets the value for Job to be an explicit nil + +### UnsetJob +`func (o *JobRegisterRequest) UnsetJob()` + +UnsetJob ensures that no value is present for Job, not even an explicit nil ### GetJobModifyIndex `func (o *JobRegisterRequest) GetJobModifyIndex() int32` diff --git a/clients/go/v1/docs/JobSummary.md b/clients/go/v1/docs/JobSummary.md index 6ce0e9e1..7aaaff16 100644 --- a/clients/go/v1/docs/JobSummary.md +++ b/clients/go/v1/docs/JobSummary.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Children** | Pointer to [**JobChildrenSummary**](JobChildrenSummary.md) | | [optional] +**Children** | Pointer to [**NullableJobChildrenSummary**](JobChildrenSummary.md) | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] **JobID** | Pointer to **string** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] @@ -55,6 +55,16 @@ SetChildren sets Children field to given value. HasChildren returns a boolean if a field has been set. +### SetChildrenNil + +`func (o *JobSummary) SetChildrenNil(b bool)` + + SetChildrenNil sets the value for Children to be an explicit nil + +### UnsetChildren +`func (o *JobSummary) UnsetChildren()` + +UnsetChildren ensures that no value is present for Children, not even an explicit nil ### GetCreateIndex `func (o *JobSummary) GetCreateIndex() int32` diff --git a/clients/go/v1/docs/JobValidateRequest.md b/clients/go/v1/docs/JobValidateRequest.md index e4f20460..f93b3116 100644 --- a/clients/go/v1/docs/JobValidateRequest.md +++ b/clients/go/v1/docs/JobValidateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Job** | Pointer to [**Job**](Job.md) | | [optional] +**Job** | Pointer to [**NullableJob**](Job.md) | | [optional] **Namespace** | Pointer to **string** | | [optional] **Region** | Pointer to **string** | | [optional] **SecretID** | Pointer to **string** | | [optional] @@ -53,6 +53,16 @@ SetJob sets Job field to given value. HasJob returns a boolean if a field has been set. +### SetJobNil + +`func (o *JobValidateRequest) SetJobNil(b bool)` + + SetJobNil sets the value for Job to be an explicit nil + +### UnsetJob +`func (o *JobValidateRequest) UnsetJob()` + +UnsetJob ensures that no value is present for Job, not even an explicit nil ### GetNamespace `func (o *JobValidateRequest) GetNamespace() string` diff --git a/clients/go/v1/docs/JobsApi.md b/clients/go/v1/docs/JobsApi.md index d425c928..432f32e2 100644 --- a/clients/go/v1/docs/JobsApi.md +++ b/clients/go/v1/docs/JobsApi.md @@ -56,8 +56,8 @@ func main() { global := true // bool | Boolean flag indicating whether the operation should apply to all instances of the job globally. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.DeleteJob(context.Background(), jobName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Purge(purge).Global(global).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.DeleteJob(context.Background(), jobName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Purge(purge).Global(global).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.DeleteJob``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -139,8 +139,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJob(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJob(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJob``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -226,8 +226,8 @@ func main() { all := true // bool | Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobAllocations(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).All(all).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobAllocations(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).All(all).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobAllocations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -313,8 +313,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobDeployment(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobDeployment(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobDeployment``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -400,8 +400,8 @@ func main() { all := int32(56) // int32 | Flag indicating whether to constrain by job creation index or not. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobDeployments(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).All(all).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobDeployments(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).All(all).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobDeployments``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -487,8 +487,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobEvaluations(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobEvaluations(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobEvaluations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -573,8 +573,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobScaleStatus(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobScaleStatus(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobScaleStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -659,8 +659,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobSummary(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobSummary(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobSummary``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -746,8 +746,8 @@ func main() { diffs := true // bool | Boolean flag indicating whether to compute job diffs. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobVersions(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Diffs(diffs).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobVersions(context.Background(), jobName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Diffs(diffs).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobVersions``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -832,8 +832,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.GetJobs(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.GetJobs(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.GetJobs``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -909,8 +909,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJob(context.Background(), jobName).JobRegisterRequest(jobRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJob(context.Background(), jobName).JobRegisterRequest(jobRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJob``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -987,8 +987,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobDispatch(context.Background(), jobName).JobDispatchRequest(jobDispatchRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobDispatch(context.Background(), jobName).JobDispatchRequest(jobDispatchRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobDispatch``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1065,8 +1065,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobEvaluate(context.Background(), jobName).JobEvaluateRequest(jobEvaluateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobEvaluate(context.Background(), jobName).JobEvaluateRequest(jobEvaluateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobEvaluate``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1138,8 +1138,8 @@ func main() { jobsParseRequest := *openapiclient.NewJobsParseRequest() // JobsParseRequest | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobParse(context.Background()).JobsParseRequest(jobsParseRequest).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobParse(context.Background()).JobsParseRequest(jobsParseRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobParse``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1206,8 +1206,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobPeriodicForce(context.Background(), jobName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobPeriodicForce(context.Background(), jobName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobPeriodicForce``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1283,8 +1283,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobPlan(context.Background(), jobName).JobPlanRequest(jobPlanRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobPlan(context.Background(), jobName).JobPlanRequest(jobPlanRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobPlan``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1361,8 +1361,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobRevert(context.Background(), jobName).JobRevertRequest(jobRevertRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobRevert(context.Background(), jobName).JobRevertRequest(jobRevertRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobRevert``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1439,8 +1439,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobScalingRequest(context.Background(), jobName).ScalingRequest(scalingRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobScalingRequest(context.Background(), jobName).ScalingRequest(scalingRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobScalingRequest``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1517,8 +1517,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobStability(context.Background(), jobName).JobStabilityRequest(jobStabilityRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobStability(context.Background(), jobName).JobStabilityRequest(jobStabilityRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobStability``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1594,8 +1594,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.PostJobValidateRequest(context.Background()).JobValidateRequest(jobValidateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.PostJobValidateRequest(context.Background()).JobValidateRequest(jobValidateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.PostJobValidateRequest``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1666,8 +1666,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.JobsApi.RegisterJob(context.Background()).JobRegisterRequest(jobRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JobsApi.RegisterJob(context.Background()).JobRegisterRequest(jobRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `JobsApi.RegisterJob``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/MetricsApi.md b/clients/go/v1/docs/MetricsApi.md index 7e7e9c25..2b4268b5 100644 --- a/clients/go/v1/docs/MetricsApi.md +++ b/clients/go/v1/docs/MetricsApi.md @@ -30,8 +30,8 @@ func main() { format := "format_example" // string | The format the user requested for the metrics summary (e.g. prometheus) (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.MetricsApi.GetMetricsSummary(context.Background()).Format(format).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetricsApi.GetMetricsSummary(context.Background()).Format(format).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.GetMetricsSummary``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/Namespace.md b/clients/go/v1/docs/Namespace.md index 0e2c0999..a4ed8583 100644 --- a/clients/go/v1/docs/Namespace.md +++ b/clients/go/v1/docs/Namespace.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Capabilities** | Pointer to [**NamespaceCapabilities**](NamespaceCapabilities.md) | | [optional] +**Capabilities** | Pointer to [**NullableNamespaceCapabilities**](NamespaceCapabilities.md) | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] **Description** | Pointer to **string** | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] @@ -56,6 +56,16 @@ SetCapabilities sets Capabilities field to given value. HasCapabilities returns a boolean if a field has been set. +### SetCapabilitiesNil + +`func (o *Namespace) SetCapabilitiesNil(b bool)` + + SetCapabilitiesNil sets the value for Capabilities to be an explicit nil + +### UnsetCapabilities +`func (o *Namespace) UnsetCapabilities()` + +UnsetCapabilities ensures that no value is present for Capabilities, not even an explicit nil ### GetCreateIndex `func (o *Namespace) GetCreateIndex() int32` diff --git a/clients/go/v1/docs/NamespacesApi.md b/clients/go/v1/docs/NamespacesApi.md index 89fe8e57..a90fd829 100644 --- a/clients/go/v1/docs/NamespacesApi.md +++ b/clients/go/v1/docs/NamespacesApi.md @@ -37,8 +37,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NamespacesApi.CreateNamespace(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NamespacesApi.CreateNamespace(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.CreateNamespace``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -106,8 +106,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NamespacesApi.DeleteNamespace(context.Background(), namespaceName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NamespacesApi.DeleteNamespace(context.Background(), namespaceName).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.DeleteNamespace``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -185,8 +185,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NamespacesApi.GetNamespace(context.Background(), namespaceName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NamespacesApi.GetNamespace(context.Background(), namespaceName).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.GetNamespace``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -270,8 +270,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NamespacesApi.GetNamespaces(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NamespacesApi.GetNamespaces(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.GetNamespaces``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -347,8 +347,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NamespacesApi.PostNamespace(context.Background(), namespaceName).Namespace2(namespace2).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NamespacesApi.PostNamespace(context.Background(), namespaceName).Namespace2(namespace2).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.PostNamespace``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/NetworkResource.md b/clients/go/v1/docs/NetworkResource.md index e1731526..93a6040d 100644 --- a/clients/go/v1/docs/NetworkResource.md +++ b/clients/go/v1/docs/NetworkResource.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **CIDR** | Pointer to **string** | | [optional] -**DNS** | Pointer to [**DNSConfig**](DNSConfig.md) | | [optional] +**DNS** | Pointer to [**NullableDNSConfig**](DNSConfig.md) | | [optional] **Device** | Pointer to **string** | | [optional] **DynamicPorts** | Pointer to [**[]Port**](Port.md) | | [optional] **Hostname** | Pointer to **string** | | [optional] @@ -83,6 +83,16 @@ SetDNS sets DNS field to given value. HasDNS returns a boolean if a field has been set. +### SetDNSNil + +`func (o *NetworkResource) SetDNSNil(b bool)` + + SetDNSNil sets the value for DNS to be an explicit nil + +### UnsetDNS +`func (o *NetworkResource) UnsetDNS()` + +UnsetDNS ensures that no value is present for DNS, not even an explicit nil ### GetDevice `func (o *NetworkResource) GetDevice() string` diff --git a/clients/go/v1/docs/Node.md b/clients/go/v1/docs/Node.md index 77680f3d..fbfadc0a 100644 --- a/clients/go/v1/docs/Node.md +++ b/clients/go/v1/docs/Node.md @@ -11,23 +11,23 @@ Name | Type | Description | Notes **CreateIndex** | Pointer to **int32** | | [optional] **Datacenter** | Pointer to **string** | | [optional] **Drain** | Pointer to **bool** | | [optional] -**DrainStrategy** | Pointer to [**DrainStrategy**](DrainStrategy.md) | | [optional] +**DrainStrategy** | Pointer to [**NullableDrainStrategy**](DrainStrategy.md) | | [optional] **Drivers** | Pointer to [**map[string]DriverInfo**](DriverInfo.md) | | [optional] **Events** | Pointer to [**[]NodeEvent**](NodeEvent.md) | | [optional] **HTTPAddr** | Pointer to **string** | | [optional] **HostNetworks** | Pointer to [**map[string]HostNetworkInfo**](HostNetworkInfo.md) | | [optional] **HostVolumes** | Pointer to [**map[string]HostVolumeInfo**](HostVolumeInfo.md) | | [optional] **ID** | Pointer to **string** | | [optional] -**LastDrain** | Pointer to [**DrainMetadata**](DrainMetadata.md) | | [optional] +**LastDrain** | Pointer to [**NullableDrainMetadata**](DrainMetadata.md) | | [optional] **Links** | Pointer to **map[string]string** | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **Name** | Pointer to **string** | | [optional] **NodeClass** | Pointer to **string** | | [optional] -**NodeResources** | Pointer to [**NodeResources**](NodeResources.md) | | [optional] -**Reserved** | Pointer to [**Resources**](Resources.md) | | [optional] -**ReservedResources** | Pointer to [**NodeReservedResources**](NodeReservedResources.md) | | [optional] -**Resources** | Pointer to [**Resources**](Resources.md) | | [optional] +**NodeResources** | Pointer to [**NullableNodeResources**](NodeResources.md) | | [optional] +**Reserved** | Pointer to [**NullableResources**](Resources.md) | | [optional] +**ReservedResources** | Pointer to [**NullableNodeReservedResources**](NodeReservedResources.md) | | [optional] +**Resources** | Pointer to [**NullableResources**](Resources.md) | | [optional] **SchedulingEligibility** | Pointer to **string** | | [optional] **Status** | Pointer to **string** | | [optional] **StatusDescription** | Pointer to **string** | | [optional] @@ -253,6 +253,16 @@ SetDrainStrategy sets DrainStrategy field to given value. HasDrainStrategy returns a boolean if a field has been set. +### SetDrainStrategyNil + +`func (o *Node) SetDrainStrategyNil(b bool)` + + SetDrainStrategyNil sets the value for DrainStrategy to be an explicit nil + +### UnsetDrainStrategy +`func (o *Node) UnsetDrainStrategy()` + +UnsetDrainStrategy ensures that no value is present for DrainStrategy, not even an explicit nil ### GetDrivers `func (o *Node) GetDrivers() map[string]DriverInfo` @@ -428,6 +438,16 @@ SetLastDrain sets LastDrain field to given value. HasLastDrain returns a boolean if a field has been set. +### SetLastDrainNil + +`func (o *Node) SetLastDrainNil(b bool)` + + SetLastDrainNil sets the value for LastDrain to be an explicit nil + +### UnsetLastDrain +`func (o *Node) UnsetLastDrain()` + +UnsetLastDrain ensures that no value is present for LastDrain, not even an explicit nil ### GetLinks `func (o *Node) GetLinks() map[string]string` @@ -578,6 +598,16 @@ SetNodeResources sets NodeResources field to given value. HasNodeResources returns a boolean if a field has been set. +### SetNodeResourcesNil + +`func (o *Node) SetNodeResourcesNil(b bool)` + + SetNodeResourcesNil sets the value for NodeResources to be an explicit nil + +### UnsetNodeResources +`func (o *Node) UnsetNodeResources()` + +UnsetNodeResources ensures that no value is present for NodeResources, not even an explicit nil ### GetReserved `func (o *Node) GetReserved() Resources` @@ -603,6 +633,16 @@ SetReserved sets Reserved field to given value. HasReserved returns a boolean if a field has been set. +### SetReservedNil + +`func (o *Node) SetReservedNil(b bool)` + + SetReservedNil sets the value for Reserved to be an explicit nil + +### UnsetReserved +`func (o *Node) UnsetReserved()` + +UnsetReserved ensures that no value is present for Reserved, not even an explicit nil ### GetReservedResources `func (o *Node) GetReservedResources() NodeReservedResources` @@ -628,6 +668,16 @@ SetReservedResources sets ReservedResources field to given value. HasReservedResources returns a boolean if a field has been set. +### SetReservedResourcesNil + +`func (o *Node) SetReservedResourcesNil(b bool)` + + SetReservedResourcesNil sets the value for ReservedResources to be an explicit nil + +### UnsetReservedResources +`func (o *Node) UnsetReservedResources()` + +UnsetReservedResources ensures that no value is present for ReservedResources, not even an explicit nil ### GetResources `func (o *Node) GetResources() Resources` @@ -653,6 +703,16 @@ SetResources sets Resources field to given value. HasResources returns a boolean if a field has been set. +### SetResourcesNil + +`func (o *Node) SetResourcesNil(b bool)` + + SetResourcesNil sets the value for Resources to be an explicit nil + +### UnsetResources +`func (o *Node) UnsetResources()` + +UnsetResources ensures that no value is present for Resources, not even an explicit nil ### GetSchedulingEligibility `func (o *Node) GetSchedulingEligibility() string` diff --git a/clients/go/v1/docs/NodeDevice.md b/clients/go/v1/docs/NodeDevice.md index e432a48c..09e579f8 100644 --- a/clients/go/v1/docs/NodeDevice.md +++ b/clients/go/v1/docs/NodeDevice.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **HealthDescription** | Pointer to **string** | | [optional] **Healthy** | Pointer to **bool** | | [optional] **ID** | Pointer to **string** | | [optional] -**Locality** | Pointer to [**NodeDeviceLocality**](NodeDeviceLocality.md) | | [optional] +**Locality** | Pointer to [**NullableNodeDeviceLocality**](NodeDeviceLocality.md) | | [optional] ## Methods @@ -128,6 +128,16 @@ SetLocality sets Locality field to given value. HasLocality returns a boolean if a field has been set. +### SetLocalityNil + +`func (o *NodeDevice) SetLocalityNil(b bool)` + + SetLocalityNil sets the value for Locality to be an explicit nil + +### UnsetLocality +`func (o *NodeDevice) UnsetLocality()` + +UnsetLocality ensures that no value is present for Locality, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/NodeEvent.md b/clients/go/v1/docs/NodeEvent.md index 5ce2c5d7..cf049bf8 100644 --- a/clients/go/v1/docs/NodeEvent.md +++ b/clients/go/v1/docs/NodeEvent.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **Details** | Pointer to **map[string]string** | | [optional] **Message** | Pointer to **string** | | [optional] **Subsystem** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**Timestamp** | Pointer to **NullableTime** | | [optional] ## Methods @@ -154,6 +154,16 @@ SetTimestamp sets Timestamp field to given value. HasTimestamp returns a boolean if a field has been set. +### SetTimestampNil + +`func (o *NodeEvent) SetTimestampNil(b bool)` + + SetTimestampNil sets the value for Timestamp to be an explicit nil + +### UnsetTimestamp +`func (o *NodeEvent) UnsetTimestamp()` + +UnsetTimestamp ensures that no value is present for Timestamp, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/NodeListStub.md b/clients/go/v1/docs/NodeListStub.md index 776ba1cf..bd4cd4e0 100644 --- a/clients/go/v1/docs/NodeListStub.md +++ b/clients/go/v1/docs/NodeListStub.md @@ -11,12 +11,12 @@ Name | Type | Description | Notes **Drain** | Pointer to **bool** | | [optional] **Drivers** | Pointer to [**map[string]DriverInfo**](DriverInfo.md) | | [optional] **ID** | Pointer to **string** | | [optional] -**LastDrain** | Pointer to [**DrainMetadata**](DrainMetadata.md) | | [optional] +**LastDrain** | Pointer to [**NullableDrainMetadata**](DrainMetadata.md) | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **Name** | Pointer to **string** | | [optional] **NodeClass** | Pointer to **string** | | [optional] -**NodeResources** | Pointer to [**NodeResources**](NodeResources.md) | | [optional] -**ReservedResources** | Pointer to [**NodeReservedResources**](NodeReservedResources.md) | | [optional] +**NodeResources** | Pointer to [**NullableNodeResources**](NodeResources.md) | | [optional] +**ReservedResources** | Pointer to [**NullableNodeReservedResources**](NodeReservedResources.md) | | [optional] **SchedulingEligibility** | Pointer to **string** | | [optional] **Status** | Pointer to **string** | | [optional] **StatusDescription** | Pointer to **string** | | [optional] @@ -241,6 +241,16 @@ SetLastDrain sets LastDrain field to given value. HasLastDrain returns a boolean if a field has been set. +### SetLastDrainNil + +`func (o *NodeListStub) SetLastDrainNil(b bool)` + + SetLastDrainNil sets the value for LastDrain to be an explicit nil + +### UnsetLastDrain +`func (o *NodeListStub) UnsetLastDrain()` + +UnsetLastDrain ensures that no value is present for LastDrain, not even an explicit nil ### GetModifyIndex `func (o *NodeListStub) GetModifyIndex() int32` @@ -341,6 +351,16 @@ SetNodeResources sets NodeResources field to given value. HasNodeResources returns a boolean if a field has been set. +### SetNodeResourcesNil + +`func (o *NodeListStub) SetNodeResourcesNil(b bool)` + + SetNodeResourcesNil sets the value for NodeResources to be an explicit nil + +### UnsetNodeResources +`func (o *NodeListStub) UnsetNodeResources()` + +UnsetNodeResources ensures that no value is present for NodeResources, not even an explicit nil ### GetReservedResources `func (o *NodeListStub) GetReservedResources() NodeReservedResources` @@ -366,6 +386,16 @@ SetReservedResources sets ReservedResources field to given value. HasReservedResources returns a boolean if a field has been set. +### SetReservedResourcesNil + +`func (o *NodeListStub) SetReservedResourcesNil(b bool)` + + SetReservedResourcesNil sets the value for ReservedResources to be an explicit nil + +### UnsetReservedResources +`func (o *NodeListStub) UnsetReservedResources()` + +UnsetReservedResources ensures that no value is present for ReservedResources, not even an explicit nil ### GetSchedulingEligibility `func (o *NodeListStub) GetSchedulingEligibility() string` diff --git a/clients/go/v1/docs/NodeReservedResources.md b/clients/go/v1/docs/NodeReservedResources.md index deb18bf1..4edb581f 100644 --- a/clients/go/v1/docs/NodeReservedResources.md +++ b/clients/go/v1/docs/NodeReservedResources.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cpu** | Pointer to [**NodeReservedCpuResources**](NodeReservedCpuResources.md) | | [optional] -**Disk** | Pointer to [**NodeReservedDiskResources**](NodeReservedDiskResources.md) | | [optional] -**Memory** | Pointer to [**NodeReservedMemoryResources**](NodeReservedMemoryResources.md) | | [optional] -**Networks** | Pointer to [**NodeReservedNetworkResources**](NodeReservedNetworkResources.md) | | [optional] +**Cpu** | Pointer to [**NullableNodeReservedCpuResources**](NodeReservedCpuResources.md) | | [optional] +**Disk** | Pointer to [**NullableNodeReservedDiskResources**](NodeReservedDiskResources.md) | | [optional] +**Memory** | Pointer to [**NullableNodeReservedMemoryResources**](NodeReservedMemoryResources.md) | | [optional] +**Networks** | Pointer to [**NullableNodeReservedNetworkResources**](NodeReservedNetworkResources.md) | | [optional] ## Methods @@ -53,6 +53,16 @@ SetCpu sets Cpu field to given value. HasCpu returns a boolean if a field has been set. +### SetCpuNil + +`func (o *NodeReservedResources) SetCpuNil(b bool)` + + SetCpuNil sets the value for Cpu to be an explicit nil + +### UnsetCpu +`func (o *NodeReservedResources) UnsetCpu()` + +UnsetCpu ensures that no value is present for Cpu, not even an explicit nil ### GetDisk `func (o *NodeReservedResources) GetDisk() NodeReservedDiskResources` @@ -78,6 +88,16 @@ SetDisk sets Disk field to given value. HasDisk returns a boolean if a field has been set. +### SetDiskNil + +`func (o *NodeReservedResources) SetDiskNil(b bool)` + + SetDiskNil sets the value for Disk to be an explicit nil + +### UnsetDisk +`func (o *NodeReservedResources) UnsetDisk()` + +UnsetDisk ensures that no value is present for Disk, not even an explicit nil ### GetMemory `func (o *NodeReservedResources) GetMemory() NodeReservedMemoryResources` @@ -103,6 +123,16 @@ SetMemory sets Memory field to given value. HasMemory returns a boolean if a field has been set. +### SetMemoryNil + +`func (o *NodeReservedResources) SetMemoryNil(b bool)` + + SetMemoryNil sets the value for Memory to be an explicit nil + +### UnsetMemory +`func (o *NodeReservedResources) UnsetMemory()` + +UnsetMemory ensures that no value is present for Memory, not even an explicit nil ### GetNetworks `func (o *NodeReservedResources) GetNetworks() NodeReservedNetworkResources` @@ -128,6 +158,16 @@ SetNetworks sets Networks field to given value. HasNetworks returns a boolean if a field has been set. +### SetNetworksNil + +`func (o *NodeReservedResources) SetNetworksNil(b bool)` + + SetNetworksNil sets the value for Networks to be an explicit nil + +### UnsetNetworks +`func (o *NodeReservedResources) UnsetNetworks()` + +UnsetNetworks ensures that no value is present for Networks, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/NodeResources.md b/clients/go/v1/docs/NodeResources.md index 9a8a19f6..97171773 100644 --- a/clients/go/v1/docs/NodeResources.md +++ b/clients/go/v1/docs/NodeResources.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cpu** | Pointer to [**NodeCpuResources**](NodeCpuResources.md) | | [optional] +**Cpu** | Pointer to [**NullableNodeCpuResources**](NodeCpuResources.md) | | [optional] **Devices** | Pointer to [**[]NodeDeviceResource**](NodeDeviceResource.md) | | [optional] -**Disk** | Pointer to [**NodeDiskResources**](NodeDiskResources.md) | | [optional] +**Disk** | Pointer to [**NullableNodeDiskResources**](NodeDiskResources.md) | | [optional] **MaxDynamicPort** | Pointer to **int32** | | [optional] -**Memory** | Pointer to [**NodeMemoryResources**](NodeMemoryResources.md) | | [optional] +**Memory** | Pointer to [**NullableNodeMemoryResources**](NodeMemoryResources.md) | | [optional] **MinDynamicPort** | Pointer to **int32** | | [optional] **Networks** | Pointer to [**[]NetworkResource**](NetworkResource.md) | | [optional] @@ -56,6 +56,16 @@ SetCpu sets Cpu field to given value. HasCpu returns a boolean if a field has been set. +### SetCpuNil + +`func (o *NodeResources) SetCpuNil(b bool)` + + SetCpuNil sets the value for Cpu to be an explicit nil + +### UnsetCpu +`func (o *NodeResources) UnsetCpu()` + +UnsetCpu ensures that no value is present for Cpu, not even an explicit nil ### GetDevices `func (o *NodeResources) GetDevices() []NodeDeviceResource` @@ -106,6 +116,16 @@ SetDisk sets Disk field to given value. HasDisk returns a boolean if a field has been set. +### SetDiskNil + +`func (o *NodeResources) SetDiskNil(b bool)` + + SetDiskNil sets the value for Disk to be an explicit nil + +### UnsetDisk +`func (o *NodeResources) UnsetDisk()` + +UnsetDisk ensures that no value is present for Disk, not even an explicit nil ### GetMaxDynamicPort `func (o *NodeResources) GetMaxDynamicPort() int32` @@ -156,6 +176,16 @@ SetMemory sets Memory field to given value. HasMemory returns a boolean if a field has been set. +### SetMemoryNil + +`func (o *NodeResources) SetMemoryNil(b bool)` + + SetMemoryNil sets the value for Memory to be an explicit nil + +### UnsetMemory +`func (o *NodeResources) UnsetMemory()` + +UnsetMemory ensures that no value is present for Memory, not even an explicit nil ### GetMinDynamicPort `func (o *NodeResources) GetMinDynamicPort() int32` diff --git a/clients/go/v1/docs/NodeUpdateDrainRequest.md b/clients/go/v1/docs/NodeUpdateDrainRequest.md index 1c104a0b..fe3d5c1d 100644 --- a/clients/go/v1/docs/NodeUpdateDrainRequest.md +++ b/clients/go/v1/docs/NodeUpdateDrainRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DrainSpec** | Pointer to [**DrainSpec**](DrainSpec.md) | | [optional] +**DrainSpec** | Pointer to [**NullableDrainSpec**](DrainSpec.md) | | [optional] **MarkEligible** | Pointer to **bool** | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] **NodeID** | Pointer to **string** | | [optional] @@ -53,6 +53,16 @@ SetDrainSpec sets DrainSpec field to given value. HasDrainSpec returns a boolean if a field has been set. +### SetDrainSpecNil + +`func (o *NodeUpdateDrainRequest) SetDrainSpecNil(b bool)` + + SetDrainSpecNil sets the value for DrainSpec to be an explicit nil + +### UnsetDrainSpec +`func (o *NodeUpdateDrainRequest) UnsetDrainSpec()` + +UnsetDrainSpec ensures that no value is present for DrainSpec, not even an explicit nil ### GetMarkEligible `func (o *NodeUpdateDrainRequest) GetMarkEligible() bool` diff --git a/clients/go/v1/docs/NodesApi.md b/clients/go/v1/docs/NodesApi.md index a87a08c6..cbedf2ae 100644 --- a/clients/go/v1/docs/NodesApi.md +++ b/clients/go/v1/docs/NodesApi.md @@ -44,8 +44,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NodesApi.GetNode(context.Background(), nodeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.GetNode(context.Background(), nodeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetNode``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -130,8 +130,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NodesApi.GetNodeAllocations(context.Background(), nodeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.GetNodeAllocations(context.Background(), nodeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetNodeAllocations``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -216,8 +216,8 @@ func main() { resources := true // bool | Whether or not to include the NodeResources and ReservedResources fields in the response. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NodesApi.GetNodes(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Resources(resources).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.GetNodes(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Resources(resources).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetNodes``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -299,8 +299,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NodesApi.UpdateNodeDrain(context.Background(), nodeId).NodeUpdateDrainRequest(nodeUpdateDrainRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.UpdateNodeDrain(context.Background(), nodeId).NodeUpdateDrainRequest(nodeUpdateDrainRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.UpdateNodeDrain``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -387,8 +387,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NodesApi.UpdateNodeEligibility(context.Background(), nodeId).NodeUpdateEligibilityRequest(nodeUpdateEligibilityRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.UpdateNodeEligibility(context.Background(), nodeId).NodeUpdateEligibilityRequest(nodeUpdateEligibilityRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.UpdateNodeEligibility``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -474,8 +474,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.NodesApi.UpdateNodePurge(context.Background(), nodeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.UpdateNodePurge(context.Background(), nodeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.UpdateNodePurge``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/OneTimeToken.md b/clients/go/v1/docs/OneTimeToken.md index b33d392d..4a47f353 100644 --- a/clients/go/v1/docs/OneTimeToken.md +++ b/clients/go/v1/docs/OneTimeToken.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AccessorID** | Pointer to **string** | | [optional] **CreateIndex** | Pointer to **int32** | | [optional] -**ExpiresAt** | Pointer to **time.Time** | | [optional] +**ExpiresAt** | Pointer to **NullableTime** | | [optional] **ModifyIndex** | Pointer to **int32** | | [optional] **OneTimeSecretID** | Pointer to **string** | | [optional] @@ -104,6 +104,16 @@ SetExpiresAt sets ExpiresAt field to given value. HasExpiresAt returns a boolean if a field has been set. +### SetExpiresAtNil + +`func (o *OneTimeToken) SetExpiresAtNil(b bool)` + + SetExpiresAtNil sets the value for ExpiresAt to be an explicit nil + +### UnsetExpiresAt +`func (o *OneTimeToken) UnsetExpiresAt()` + +UnsetExpiresAt ensures that no value is present for ExpiresAt, not even an explicit nil ### GetModifyIndex `func (o *OneTimeToken) GetModifyIndex() int32` diff --git a/clients/go/v1/docs/OperatorApi.md b/clients/go/v1/docs/OperatorApi.md index e231989e..ad96844e 100644 --- a/clients/go/v1/docs/OperatorApi.md +++ b/clients/go/v1/docs/OperatorApi.md @@ -39,8 +39,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.DeleteOperatorRaftPeer(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.DeleteOperatorRaftPeer(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.DeleteOperatorRaftPeer``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -112,8 +112,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.GetOperatorAutopilotConfiguration(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.GetOperatorAutopilotConfiguration(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.GetOperatorAutopilotConfiguration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -192,8 +192,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.GetOperatorAutopilotHealth(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.GetOperatorAutopilotHealth(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.GetOperatorAutopilotHealth``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -272,8 +272,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.GetOperatorRaftConfiguration(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.GetOperatorRaftConfiguration(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.GetOperatorRaftConfiguration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -352,8 +352,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.GetOperatorSchedulerConfiguration(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.GetOperatorSchedulerConfiguration(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.GetOperatorSchedulerConfiguration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -428,8 +428,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.PostOperatorSchedulerConfiguration(context.Background()).SchedulerConfiguration(schedulerConfiguration).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.PostOperatorSchedulerConfiguration(context.Background()).SchedulerConfiguration(schedulerConfiguration).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.PostOperatorSchedulerConfiguration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -500,8 +500,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.OperatorApi.PutOperatorAutopilotConfiguration(context.Background()).AutopilotConfiguration(autopilotConfiguration).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatorApi.PutOperatorAutopilotConfiguration(context.Background()).AutopilotConfiguration(autopilotConfiguration).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `OperatorApi.PutOperatorAutopilotConfiguration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/PluginsApi.md b/clients/go/v1/docs/PluginsApi.md index ee8704ca..e70a218b 100644 --- a/clients/go/v1/docs/PluginsApi.md +++ b/clients/go/v1/docs/PluginsApi.md @@ -40,8 +40,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PluginsApi.GetPluginCSI(context.Background(), pluginID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PluginsApi.GetPluginCSI(context.Background(), pluginID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PluginsApi.GetPluginCSI``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -125,8 +125,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PluginsApi.GetPlugins(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PluginsApi.GetPlugins(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PluginsApi.GetPlugins``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/QuotaLimit.md b/clients/go/v1/docs/QuotaLimit.md index 1174c266..dea1b78f 100644 --- a/clients/go/v1/docs/QuotaLimit.md +++ b/clients/go/v1/docs/QuotaLimit.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Hash** | Pointer to **string** | | [optional] **Region** | Pointer to **string** | | [optional] -**RegionLimit** | Pointer to [**Resources**](Resources.md) | | [optional] +**RegionLimit** | Pointer to [**NullableResources**](Resources.md) | | [optional] ## Methods @@ -102,6 +102,16 @@ SetRegionLimit sets RegionLimit field to given value. HasRegionLimit returns a boolean if a field has been set. +### SetRegionLimitNil + +`func (o *QuotaLimit) SetRegionLimitNil(b bool)` + + SetRegionLimitNil sets the value for RegionLimit to be an explicit nil + +### UnsetRegionLimit +`func (o *QuotaLimit) UnsetRegionLimit()` + +UnsetRegionLimit ensures that no value is present for RegionLimit, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/RegionsApi.md b/clients/go/v1/docs/RegionsApi.md index 925529f3..87f62823 100644 --- a/clients/go/v1/docs/RegionsApi.md +++ b/clients/go/v1/docs/RegionsApi.md @@ -29,8 +29,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.RegionsApi.GetRegions(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RegionsApi.GetRegions(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `RegionsApi.GetRegions``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/ScalingApi.md b/clients/go/v1/docs/ScalingApi.md index 7bf6da1f..7908f919 100644 --- a/clients/go/v1/docs/ScalingApi.md +++ b/clients/go/v1/docs/ScalingApi.md @@ -39,8 +39,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ScalingApi.GetScalingPolicies(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScalingApi.GetScalingPolicies(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScalingApi.GetScalingPolicies``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -120,8 +120,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ScalingApi.GetScalingPolicy(context.Background(), policyID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScalingApi.GetScalingPolicy(context.Background(), policyID).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScalingApi.GetScalingPolicy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/SchedulerConfiguration.md b/clients/go/v1/docs/SchedulerConfiguration.md index cb9b532f..38c77377 100644 --- a/clients/go/v1/docs/SchedulerConfiguration.md +++ b/clients/go/v1/docs/SchedulerConfiguration.md @@ -2,13 +2,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CreateIndex** | Pointer to **int32** | | [optional] -**MemoryOversubscriptionEnabled** | Pointer to **bool** | | [optional] -**ModifyIndex** | Pointer to **int32** | | [optional] -**PauseEvalBroker** | Pointer to **bool** | | [optional] -**PreemptionConfig** | Pointer to [**PreemptionConfig**](PreemptionConfig.md) | | [optional] +| Name | Type | Description | Notes | +| --------------------------------- | -------------------------------------------------------------- | ----------- | ---------- | +| **CreateIndex** | Pointer to **int32** | | [optional] | +| **MemoryOversubscriptionEnabled** | Pointer to **bool** | | [optional] | +| **ModifyIndex** | Pointer to **int32** | | [optional] | +| **PauseEvalBroker** | Pointer to **bool** | | [optional] | +| **PreemptionConfig** | Pointer to [**NullablePreemptionConfig**](PreemptionConfig.md) | | [optional] | +>>>>>>> af4e01c (fix map spec generation and add nullable fields) **RejectJobRegistration** | Pointer to **bool** | | [optional] **SchedulerAlgorithm** | Pointer to **string** | | [optional] @@ -156,6 +157,16 @@ SetPreemptionConfig sets PreemptionConfig field to given value. HasPreemptionConfig returns a boolean if a field has been set. +### SetPreemptionConfigNil + +`func (o *SchedulerConfiguration) SetPreemptionConfigNil(b bool)` + + SetPreemptionConfigNil sets the value for PreemptionConfig to be an explicit nil + +### UnsetPreemptionConfig +`func (o *SchedulerConfiguration) UnsetPreemptionConfig()` + +UnsetPreemptionConfig ensures that no value is present for PreemptionConfig, not even an explicit nil ### GetRejectJobRegistration `func (o *SchedulerConfiguration) GetRejectJobRegistration() bool` diff --git a/clients/go/v1/docs/SchedulerConfigurationResponse.md b/clients/go/v1/docs/SchedulerConfigurationResponse.md index d27f2cb0..bcf6be20 100644 --- a/clients/go/v1/docs/SchedulerConfigurationResponse.md +++ b/clients/go/v1/docs/SchedulerConfigurationResponse.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **LastIndex** | Pointer to **int32** | | [optional] **NextToken** | Pointer to **string** | | [optional] **RequestTime** | Pointer to **int64** | | [optional] -**SchedulerConfig** | Pointer to [**SchedulerConfiguration**](SchedulerConfiguration.md) | | [optional] +**SchedulerConfig** | Pointer to [**NullableSchedulerConfiguration**](SchedulerConfiguration.md) | | [optional] ## Methods @@ -180,6 +180,16 @@ SetSchedulerConfig sets SchedulerConfig field to given value. HasSchedulerConfig returns a boolean if a field has been set. +### SetSchedulerConfigNil + +`func (o *SchedulerConfigurationResponse) SetSchedulerConfigNil(b bool)` + + SetSchedulerConfigNil sets the value for SchedulerConfig to be an explicit nil + +### UnsetSchedulerConfig +`func (o *SchedulerConfigurationResponse) UnsetSchedulerConfig()` + +UnsetSchedulerConfig ensures that no value is present for SchedulerConfig, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/SearchApi.md b/clients/go/v1/docs/SearchApi.md index 4fea39e9..c5c59738 100644 --- a/clients/go/v1/docs/SearchApi.md +++ b/clients/go/v1/docs/SearchApi.md @@ -40,8 +40,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.SearchApi.GetFuzzySearch(context.Background()).FuzzySearchRequest(fuzzySearchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SearchApi.GetFuzzySearch(context.Background()).FuzzySearchRequest(fuzzySearchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SearchApi.GetFuzzySearch``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -122,8 +122,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.SearchApi.GetSearch(context.Background()).SearchRequest(searchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SearchApi.GetSearch(context.Background()).SearchRequest(searchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SearchApi.GetSearch``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/ServerHealth.md b/clients/go/v1/docs/ServerHealth.md index ac57cee6..fe9133bb 100644 --- a/clients/go/v1/docs/ServerHealth.md +++ b/clients/go/v1/docs/ServerHealth.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **Leader** | Pointer to **bool** | | [optional] **Name** | Pointer to **string** | | [optional] **SerfStatus** | Pointer to **string** | | [optional] -**StableSince** | Pointer to **time.Time** | | [optional] +**StableSince** | Pointer to **NullableTime** | | [optional] **Version** | Pointer to **string** | | [optional] **Voter** | Pointer to **bool** | | [optional] @@ -286,6 +286,16 @@ SetStableSince sets StableSince field to given value. HasStableSince returns a boolean if a field has been set. +### SetStableSinceNil + +`func (o *ServerHealth) SetStableSinceNil(b bool)` + + SetStableSinceNil sets the value for StableSince to be an explicit nil + +### UnsetStableSince +`func (o *ServerHealth) UnsetStableSince()` + +UnsetStableSince ensures that no value is present for StableSince, not even an explicit nil ### GetVersion `func (o *ServerHealth) GetVersion() string` diff --git a/clients/go/v1/docs/Service.md b/clients/go/v1/docs/Service.md index 98a2cd5f..b6496e0a 100644 --- a/clients/go/v1/docs/Service.md +++ b/clients/go/v1/docs/Service.md @@ -8,9 +8,9 @@ Name | Type | Description | Notes **AddressMode** | Pointer to **string** | | [optional] **CanaryMeta** | Pointer to **map[string]string** | | [optional] **CanaryTags** | Pointer to **[]string** | | [optional] -**CheckRestart** | Pointer to [**CheckRestart**](CheckRestart.md) | | [optional] +**CheckRestart** | Pointer to [**NullableCheckRestart**](CheckRestart.md) | | [optional] **Checks** | Pointer to [**[]ServiceCheck**](ServiceCheck.md) | | [optional] -**Connect** | Pointer to [**ConsulConnect**](ConsulConnect.md) | | [optional] +**Connect** | Pointer to [**NullableConsulConnect**](ConsulConnect.md) | | [optional] **EnableTagOverride** | Pointer to **bool** | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] **Name** | Pointer to **string** | | [optional] @@ -165,6 +165,16 @@ SetCheckRestart sets CheckRestart field to given value. HasCheckRestart returns a boolean if a field has been set. +### SetCheckRestartNil + +`func (o *Service) SetCheckRestartNil(b bool)` + + SetCheckRestartNil sets the value for CheckRestart to be an explicit nil + +### UnsetCheckRestart +`func (o *Service) UnsetCheckRestart()` + +UnsetCheckRestart ensures that no value is present for CheckRestart, not even an explicit nil ### GetChecks `func (o *Service) GetChecks() []ServiceCheck` @@ -215,6 +225,16 @@ SetConnect sets Connect field to given value. HasConnect returns a boolean if a field has been set. +### SetConnectNil + +`func (o *Service) SetConnectNil(b bool)` + + SetConnectNil sets the value for Connect to be an explicit nil + +### UnsetConnect +`func (o *Service) UnsetConnect()` + +UnsetConnect ensures that no value is present for Connect, not even an explicit nil ### GetEnableTagOverride `func (o *Service) GetEnableTagOverride() bool` diff --git a/clients/go/v1/docs/ServiceCheck.md b/clients/go/v1/docs/ServiceCheck.md index ed35f0ec..5ba4b6b7 100644 --- a/clients/go/v1/docs/ServiceCheck.md +++ b/clients/go/v1/docs/ServiceCheck.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **Advertise** | Pointer to **string** | | [optional] **Args** | Pointer to **[]string** | | [optional] **Body** | Pointer to **string** | | [optional] -**CheckRestart** | Pointer to [**CheckRestart**](CheckRestart.md) | | [optional] +**CheckRestart** | Pointer to [**NullableCheckRestart**](CheckRestart.md) | | [optional] **Command** | Pointer to **string** | | [optional] **Expose** | Pointer to **bool** | | [optional] **FailuresBeforeCritical** | Pointer to **int32** | | [optional] @@ -173,6 +173,16 @@ SetCheckRestart sets CheckRestart field to given value. HasCheckRestart returns a boolean if a field has been set. +### SetCheckRestartNil + +`func (o *ServiceCheck) SetCheckRestartNil(b bool)` + + SetCheckRestartNil sets the value for CheckRestart to be an explicit nil + +### UnsetCheckRestart +`func (o *ServiceCheck) UnsetCheckRestart()` + +UnsetCheckRestart ensures that no value is present for CheckRestart, not even an explicit nil ### GetCommand `func (o *ServiceCheck) GetCommand() string` diff --git a/clients/go/v1/docs/SidecarTask.md b/clients/go/v1/docs/SidecarTask.md index 4821b7f6..b1cab5ba 100644 --- a/clients/go/v1/docs/SidecarTask.md +++ b/clients/go/v1/docs/SidecarTask.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **LogConfig** | Pointer to [**LogConfig**](LogConfig.md) | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] **Name** | Pointer to **string** | | [optional] -**Resources** | Pointer to [**Resources**](Resources.md) | | [optional] +**Resources** | Pointer to [**NullableResources**](Resources.md) | | [optional] **ShutdownDelay** | Pointer to **int64** | | [optional] **User** | Pointer to **string** | | [optional] @@ -260,6 +260,16 @@ SetResources sets Resources field to given value. HasResources returns a boolean if a field has been set. +### SetResourcesNil + +`func (o *SidecarTask) SetResourcesNil(b bool)` + + SetResourcesNil sets the value for Resources to be an explicit nil + +### UnsetResources +`func (o *SidecarTask) UnsetResources()` + +UnsetResources ensures that no value is present for Resources, not even an explicit nil ### GetShutdownDelay `func (o *SidecarTask) GetShutdownDelay() int64` diff --git a/clients/go/v1/docs/StatusApi.md b/clients/go/v1/docs/StatusApi.md index 5724b651..4b1bf727 100644 --- a/clients/go/v1/docs/StatusApi.md +++ b/clients/go/v1/docs/StatusApi.md @@ -39,8 +39,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StatusApi.GetStatusLeader(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StatusApi.GetStatusLeader(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StatusApi.GetStatusLeader``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -119,8 +119,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StatusApi.GetStatusPeers(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StatusApi.GetStatusPeers(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StatusApi.GetStatusPeers``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/SystemApi.md b/clients/go/v1/docs/SystemApi.md index bc0d1453..439a64c5 100644 --- a/clients/go/v1/docs/SystemApi.md +++ b/clients/go/v1/docs/SystemApi.md @@ -34,8 +34,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.SystemApi.PutSystemGC(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SystemApi.PutSystemGC(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SystemApi.PutSystemGC``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -102,8 +102,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.SystemApi.PutSystemReconcileSummaries(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SystemApi.PutSystemReconcileSummaries(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SystemApi.PutSystemReconcileSummaries``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/docs/Task.md b/clients/go/v1/docs/Task.md index 46f596eb..f33a4cf5 100644 --- a/clients/go/v1/docs/Task.md +++ b/clients/go/v1/docs/Task.md @@ -6,28 +6,28 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Affinities** | Pointer to [**[]Affinity**](Affinity.md) | | [optional] **Artifacts** | Pointer to [**[]TaskArtifact**](TaskArtifact.md) | | [optional] -**CSIPluginConfig** | Pointer to [**TaskCSIPluginConfig**](TaskCSIPluginConfig.md) | | [optional] +**CSIPluginConfig** | Pointer to [**NullableTaskCSIPluginConfig**](TaskCSIPluginConfig.md) | | [optional] **Config** | Pointer to **map[string]interface{}** | | [optional] **Constraints** | Pointer to [**[]Constraint**](Constraint.md) | | [optional] -**DispatchPayload** | Pointer to [**DispatchPayloadConfig**](DispatchPayloadConfig.md) | | [optional] +**DispatchPayload** | Pointer to [**NullableDispatchPayloadConfig**](DispatchPayloadConfig.md) | | [optional] **Driver** | Pointer to **string** | | [optional] **Env** | Pointer to **map[string]string** | | [optional] **KillSignal** | Pointer to **string** | | [optional] **KillTimeout** | Pointer to **int64** | | [optional] **Kind** | Pointer to **string** | | [optional] **Leader** | Pointer to **bool** | | [optional] -**Lifecycle** | Pointer to [**TaskLifecycle**](TaskLifecycle.md) | | [optional] +**Lifecycle** | Pointer to [**NullableTaskLifecycle**](TaskLifecycle.md) | | [optional] **LogConfig** | Pointer to [**LogConfig**](LogConfig.md) | | [optional] **Meta** | Pointer to **map[string]string** | | [optional] **Name** | Pointer to **string** | | [optional] -**Resources** | Pointer to [**Resources**](Resources.md) | | [optional] +**Resources** | Pointer to [**NullableResources**](Resources.md) | | [optional] **RestartPolicy** | Pointer to [**RestartPolicy**](RestartPolicy.md) | | [optional] **ScalingPolicies** | Pointer to [**[]ScalingPolicy**](ScalingPolicy.md) | | [optional] **Services** | Pointer to [**[]Service**](Service.md) | | [optional] **ShutdownDelay** | Pointer to **int64** | | [optional] **Templates** | Pointer to [**[]Template**](Template.md) | | [optional] **User** | Pointer to **string** | | [optional] -**Vault** | Pointer to [**Vault**](Vault.md) | | [optional] +**Vault** | Pointer to [**NullableVault**](Vault.md) | | [optional] **VolumeMounts** | Pointer to [**[]VolumeMount**](VolumeMount.md) | | [optional] ## Methods @@ -124,6 +124,16 @@ SetCSIPluginConfig sets CSIPluginConfig field to given value. HasCSIPluginConfig returns a boolean if a field has been set. +### SetCSIPluginConfigNil + +`func (o *Task) SetCSIPluginConfigNil(b bool)` + + SetCSIPluginConfigNil sets the value for CSIPluginConfig to be an explicit nil + +### UnsetCSIPluginConfig +`func (o *Task) UnsetCSIPluginConfig()` + +UnsetCSIPluginConfig ensures that no value is present for CSIPluginConfig, not even an explicit nil ### GetConfig `func (o *Task) GetConfig() map[string]interface{}` @@ -199,6 +209,16 @@ SetDispatchPayload sets DispatchPayload field to given value. HasDispatchPayload returns a boolean if a field has been set. +### SetDispatchPayloadNil + +`func (o *Task) SetDispatchPayloadNil(b bool)` + + SetDispatchPayloadNil sets the value for DispatchPayload to be an explicit nil + +### UnsetDispatchPayload +`func (o *Task) UnsetDispatchPayload()` + +UnsetDispatchPayload ensures that no value is present for DispatchPayload, not even an explicit nil ### GetDriver `func (o *Task) GetDriver() string` @@ -374,6 +394,16 @@ SetLifecycle sets Lifecycle field to given value. HasLifecycle returns a boolean if a field has been set. +### SetLifecycleNil + +`func (o *Task) SetLifecycleNil(b bool)` + + SetLifecycleNil sets the value for Lifecycle to be an explicit nil + +### UnsetLifecycle +`func (o *Task) UnsetLifecycle()` + +UnsetLifecycle ensures that no value is present for Lifecycle, not even an explicit nil ### GetLogConfig `func (o *Task) GetLogConfig() LogConfig` @@ -474,6 +504,16 @@ SetResources sets Resources field to given value. HasResources returns a boolean if a field has been set. +### SetResourcesNil + +`func (o *Task) SetResourcesNil(b bool)` + + SetResourcesNil sets the value for Resources to be an explicit nil + +### UnsetResources +`func (o *Task) UnsetResources()` + +UnsetResources ensures that no value is present for Resources, not even an explicit nil ### GetRestartPolicy `func (o *Task) GetRestartPolicy() RestartPolicy` @@ -649,6 +689,16 @@ SetVault sets Vault field to given value. HasVault returns a boolean if a field has been set. +### SetVaultNil + +`func (o *Task) SetVaultNil(b bool)` + + SetVaultNil sets the value for Vault to be an explicit nil + +### UnsetVault +`func (o *Task) UnsetVault()` + +UnsetVault ensures that no value is present for Vault, not even an explicit nil ### GetVolumeMounts `func (o *Task) GetVolumeMounts() []VolumeMount` diff --git a/clients/go/v1/docs/TaskGroup.md b/clients/go/v1/docs/TaskGroup.md index b2b81a85..06d4c29e 100644 --- a/clients/go/v1/docs/TaskGroup.md +++ b/clients/go/v1/docs/TaskGroup.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Affinities** | Pointer to [**[]Affinity**](Affinity.md) | | [optional] **Constraints** | Pointer to [**[]Constraint**](Constraint.md) | | [optional] -**Consul** | Pointer to [**Consul**](Consul.md) | | [optional] +**Consul** | Pointer to [**NullableConsul**](Consul.md) | | [optional] **Count** | Pointer to **int32** | | [optional] **EphemeralDisk** | Pointer to [**EphemeralDisk**](EphemeralDisk.md) | | [optional] **MaxClientDisconnect** | Pointer to **int64** | | [optional] @@ -16,7 +16,7 @@ Name | Type | Description | Notes **Networks** | Pointer to [**[]NetworkResource**](NetworkResource.md) | | [optional] **ReschedulePolicy** | Pointer to [**ReschedulePolicy**](ReschedulePolicy.md) | | [optional] **RestartPolicy** | Pointer to [**RestartPolicy**](RestartPolicy.md) | | [optional] -**Scaling** | Pointer to [**ScalingPolicy**](ScalingPolicy.md) | | [optional] +**Scaling** | Pointer to [**NullableScalingPolicy**](ScalingPolicy.md) | | [optional] **Services** | Pointer to [**[]Service**](Service.md) | | [optional] **ShutdownDelay** | Pointer to **int64** | | [optional] **Spreads** | Pointer to [**[]Spread**](Spread.md) | | [optional] @@ -119,6 +119,16 @@ SetConsul sets Consul field to given value. HasConsul returns a boolean if a field has been set. +### SetConsulNil + +`func (o *TaskGroup) SetConsulNil(b bool)` + + SetConsulNil sets the value for Consul to be an explicit nil + +### UnsetConsul +`func (o *TaskGroup) UnsetConsul()` + +UnsetConsul ensures that no value is present for Consul, not even an explicit nil ### GetCount `func (o *TaskGroup) GetCount() int32` @@ -369,6 +379,16 @@ SetScaling sets Scaling field to given value. HasScaling returns a boolean if a field has been set. +### SetScalingNil + +`func (o *TaskGroup) SetScalingNil(b bool)` + + SetScalingNil sets the value for Scaling to be an explicit nil + +### UnsetScaling +`func (o *TaskGroup) UnsetScaling()` + +UnsetScaling ensures that no value is present for Scaling, not even an explicit nil ### GetServices `func (o *TaskGroup) GetServices() []Service` diff --git a/clients/go/v1/docs/TaskState.md b/clients/go/v1/docs/TaskState.md index e96e2cf8..6e18f883 100644 --- a/clients/go/v1/docs/TaskState.md +++ b/clients/go/v1/docs/TaskState.md @@ -6,12 +6,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Events** | Pointer to [**[]TaskEvent**](TaskEvent.md) | | [optional] **Failed** | Pointer to **bool** | | [optional] -**FinishedAt** | Pointer to **time.Time** | | [optional] -**LastRestart** | Pointer to **time.Time** | | [optional] +**FinishedAt** | Pointer to **NullableTime** | | [optional] +**LastRestart** | Pointer to **NullableTime** | | [optional] **Restarts** | Pointer to **int32** | | [optional] -**StartedAt** | Pointer to **time.Time** | | [optional] +**StartedAt** | Pointer to **NullableTime** | | [optional] **State** | Pointer to **string** | | [optional] -**TaskHandle** | Pointer to [**TaskHandle**](TaskHandle.md) | | [optional] +**TaskHandle** | Pointer to [**NullableTaskHandle**](TaskHandle.md) | | [optional] ## Methods @@ -107,6 +107,16 @@ SetFinishedAt sets FinishedAt field to given value. HasFinishedAt returns a boolean if a field has been set. +### SetFinishedAtNil + +`func (o *TaskState) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *TaskState) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil ### GetLastRestart `func (o *TaskState) GetLastRestart() time.Time` @@ -132,6 +142,16 @@ SetLastRestart sets LastRestart field to given value. HasLastRestart returns a boolean if a field has been set. +### SetLastRestartNil + +`func (o *TaskState) SetLastRestartNil(b bool)` + + SetLastRestartNil sets the value for LastRestart to be an explicit nil + +### UnsetLastRestart +`func (o *TaskState) UnsetLastRestart()` + +UnsetLastRestart ensures that no value is present for LastRestart, not even an explicit nil ### GetRestarts `func (o *TaskState) GetRestarts() int32` @@ -182,6 +202,16 @@ SetStartedAt sets StartedAt field to given value. HasStartedAt returns a boolean if a field has been set. +### SetStartedAtNil + +`func (o *TaskState) SetStartedAtNil(b bool)` + + SetStartedAtNil sets the value for StartedAt to be an explicit nil + +### UnsetStartedAt +`func (o *TaskState) UnsetStartedAt()` + +UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil ### GetState `func (o *TaskState) GetState() string` @@ -232,6 +262,16 @@ SetTaskHandle sets TaskHandle field to given value. HasTaskHandle returns a boolean if a field has been set. +### SetTaskHandleNil + +`func (o *TaskState) SetTaskHandleNil(b bool)` + + SetTaskHandleNil sets the value for TaskHandle to be an explicit nil + +### UnsetTaskHandle +`func (o *TaskState) UnsetTaskHandle()` + +UnsetTaskHandle ensures that no value is present for TaskHandle, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/go/v1/docs/VolumeRequest.md b/clients/go/v1/docs/VolumeRequest.md index 57ca9201..1a9659ef 100644 --- a/clients/go/v1/docs/VolumeRequest.md +++ b/clients/go/v1/docs/VolumeRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AccessMode** | Pointer to **string** | | [optional] **AttachmentMode** | Pointer to **string** | | [optional] -**MountOptions** | Pointer to [**CSIMountOptions**](CSIMountOptions.md) | | [optional] +**MountOptions** | Pointer to [**NullableCSIMountOptions**](CSIMountOptions.md) | | [optional] **Name** | Pointer to **string** | | [optional] **PerAlloc** | Pointer to **bool** | | [optional] **ReadOnly** | Pointer to **bool** | | [optional] @@ -107,6 +107,16 @@ SetMountOptions sets MountOptions field to given value. HasMountOptions returns a boolean if a field has been set. +### SetMountOptionsNil + +`func (o *VolumeRequest) SetMountOptionsNil(b bool)` + + SetMountOptionsNil sets the value for MountOptions to be an explicit nil + +### UnsetMountOptions +`func (o *VolumeRequest) UnsetMountOptions()` + +UnsetMountOptions ensures that no value is present for MountOptions, not even an explicit nil ### GetName `func (o *VolumeRequest) GetName() string` diff --git a/clients/go/v1/docs/VolumesApi.md b/clients/go/v1/docs/VolumesApi.md index 67948b95..94ae5379 100644 --- a/clients/go/v1/docs/VolumesApi.md +++ b/clients/go/v1/docs/VolumesApi.md @@ -46,8 +46,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.CreateVolume(context.Background(), volumeId, action).CSIVolumeCreateRequest(cSIVolumeCreateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.CreateVolume(context.Background(), volumeId, action).CSIVolumeCreateRequest(cSIVolumeCreateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.CreateVolume``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -124,8 +124,8 @@ func main() { snapshotId := "snapshotId_example" // string | The ID of the snapshot to target. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.DeleteSnapshot(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).PluginId(pluginId).SnapshotId(snapshotId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.DeleteSnapshot(context.Background()).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).PluginId(pluginId).SnapshotId(snapshotId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DeleteSnapshot``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -196,8 +196,8 @@ func main() { force := "force_example" // string | Used to force the de-registration of a volume. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.DeleteVolumeRegistration(context.Background(), volumeId).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Force(force).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.DeleteVolumeRegistration(context.Background(), volumeId).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Force(force).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DeleteVolumeRegistration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -273,8 +273,8 @@ func main() { node := "node_example" // string | Specifies node to target volume operation for. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.DetachOrDeleteVolume(context.Background(), volumeId, action).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Node(node).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.DetachOrDeleteVolume(context.Background(), volumeId, action).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Node(node).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DetachOrDeleteVolume``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -355,8 +355,8 @@ func main() { pluginId := "pluginId_example" // string | Filters volume lists by plugin ID. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.GetExternalVolumes(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).PluginId(pluginId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.GetExternalVolumes(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).PluginId(pluginId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.GetExternalVolumes``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -437,8 +437,8 @@ func main() { pluginId := "pluginId_example" // string | Filters volume lists by plugin ID. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.GetSnapshots(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).PluginId(pluginId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.GetSnapshots(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).PluginId(pluginId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.GetSnapshots``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -519,8 +519,8 @@ func main() { nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.GetVolume(context.Background(), volumeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.GetVolume(context.Background(), volumeId).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.GetVolume``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -607,8 +607,8 @@ func main() { type_ := "type__example" // string | Filters volume lists to a specific type. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.GetVolumes(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).NodeId(nodeId).PluginId(pluginId).Type_(type_).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.GetVolumes(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).NodeId(nodeId).PluginId(pluginId).Type_(type_).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.GetVolumes``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -686,8 +686,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.PostSnapshot(context.Background()).CSISnapshotCreateRequest(cSISnapshotCreateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.PostSnapshot(context.Background()).CSISnapshotCreateRequest(cSISnapshotCreateRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.PostSnapshot``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -758,8 +758,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.PostVolume(context.Background()).CSIVolumeRegisterRequest(cSIVolumeRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.PostVolume(context.Background()).CSIVolumeRegisterRequest(cSIVolumeRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.PostVolume``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -829,8 +829,8 @@ func main() { idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VolumesApi.PostVolumeRegistration(context.Background(), volumeId).CSIVolumeRegisterRequest(cSIVolumeRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VolumesApi.PostVolumeRegistration(context.Background(), volumeId).CSIVolumeRegisterRequest(cSIVolumeRegisterRequest).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.PostVolumeRegistration``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/clients/go/v1/model_acl_policy.go b/clients/go/v1/model_acl_policy.go index 63bd0f19..f738681b 100644 --- a/clients/go/v1/model_acl_policy.go +++ b/clients/go/v1/model_acl_policy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_acl_policy_list_stub.go b/clients/go/v1/model_acl_policy_list_stub.go index b78230e8..9a0437df 100644 --- a/clients/go/v1/model_acl_policy_list_stub.go +++ b/clients/go/v1/model_acl_policy_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_acl_token.go b/clients/go/v1/model_acl_token.go index b31ecfdf..6b3b0f7a 100644 --- a/clients/go/v1/model_acl_token.go +++ b/clients/go/v1/model_acl_token.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,11 +20,11 @@ import ( type ACLToken struct { AccessorID *string `json:"AccessorID,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` - CreateTime *time.Time `json:"CreateTime,omitempty"` + CreateTime NullableTime `json:"CreateTime,omitempty"` Global *bool `json:"Global,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Name *string `json:"Name,omitempty"` - Policies *[]string `json:"Policies,omitempty"` + Policies []string `json:"Policies,omitempty"` SecretID *string `json:"SecretID,omitempty"` Type *string `json:"Type,omitempty"` } @@ -110,36 +110,46 @@ func (o *ACLToken) SetCreateIndex(v int32) { o.CreateIndex = &v } -// GetCreateTime returns the CreateTime field value if set, zero value otherwise. +// GetCreateTime returns the CreateTime field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ACLToken) GetCreateTime() time.Time { - if o == nil || o.CreateTime == nil { + if o == nil || o.CreateTime.Get() == nil { var ret time.Time return ret } - return *o.CreateTime + return *o.CreateTime.Get() } // GetCreateTimeOk returns a tuple with the CreateTime field value if set, nil otherwise // 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 *ACLToken) GetCreateTimeOk() (*time.Time, bool) { - if o == nil || o.CreateTime == nil { + if o == nil { return nil, false } - return o.CreateTime, true + return o.CreateTime.Get(), o.CreateTime.IsSet() } // HasCreateTime returns a boolean if a field has been set. func (o *ACLToken) HasCreateTime() bool { - if o != nil && o.CreateTime != nil { + if o != nil && o.CreateTime.IsSet() { return true } return false } -// SetCreateTime gets a reference to the given time.Time and assigns it to the CreateTime field. +// SetCreateTime gets a reference to the given NullableTime and assigns it to the CreateTime field. func (o *ACLToken) SetCreateTime(v time.Time) { - o.CreateTime = &v + o.CreateTime.Set(&v) +} +// SetCreateTimeNil sets the value for CreateTime to be an explicit nil +func (o *ACLToken) SetCreateTimeNil() { + o.CreateTime.Set(nil) +} + +// UnsetCreateTime ensures that no value is present for CreateTime, not even an explicit nil +func (o *ACLToken) UnsetCreateTime() { + o.CreateTime.Unset() } // GetGlobal returns the Global field value if set, zero value otherwise. @@ -244,12 +254,12 @@ func (o *ACLToken) GetPolicies() []string { var ret []string return ret } - return *o.Policies + return o.Policies } // GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ACLToken) GetPoliciesOk() (*[]string, bool) { +func (o *ACLToken) GetPoliciesOk() ([]string, bool) { if o == nil || o.Policies == nil { return nil, false } @@ -267,7 +277,7 @@ func (o *ACLToken) HasPolicies() bool { // SetPolicies gets a reference to the given []string and assigns it to the Policies field. func (o *ACLToken) SetPolicies(v []string) { - o.Policies = &v + o.Policies = v } // GetSecretID returns the SecretID field value if set, zero value otherwise. @@ -342,8 +352,8 @@ func (o ACLToken) MarshalJSON() ([]byte, error) { if o.CreateIndex != nil { toSerialize["CreateIndex"] = o.CreateIndex } - if o.CreateTime != nil { - toSerialize["CreateTime"] = o.CreateTime + if o.CreateTime.IsSet() { + toSerialize["CreateTime"] = o.CreateTime.Get() } if o.Global != nil { toSerialize["Global"] = o.Global diff --git a/clients/go/v1/model_acl_token_list_stub.go b/clients/go/v1/model_acl_token_list_stub.go index e4828266..b62c26a9 100644 --- a/clients/go/v1/model_acl_token_list_stub.go +++ b/clients/go/v1/model_acl_token_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,11 +20,11 @@ import ( type ACLTokenListStub struct { AccessorID *string `json:"AccessorID,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` - CreateTime *time.Time `json:"CreateTime,omitempty"` + CreateTime NullableTime `json:"CreateTime,omitempty"` Global *bool `json:"Global,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Name *string `json:"Name,omitempty"` - Policies *[]string `json:"Policies,omitempty"` + Policies []string `json:"Policies,omitempty"` Type *string `json:"Type,omitempty"` } @@ -109,36 +109,46 @@ func (o *ACLTokenListStub) SetCreateIndex(v int32) { o.CreateIndex = &v } -// GetCreateTime returns the CreateTime field value if set, zero value otherwise. +// GetCreateTime returns the CreateTime field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ACLTokenListStub) GetCreateTime() time.Time { - if o == nil || o.CreateTime == nil { + if o == nil || o.CreateTime.Get() == nil { var ret time.Time return ret } - return *o.CreateTime + return *o.CreateTime.Get() } // GetCreateTimeOk returns a tuple with the CreateTime field value if set, nil otherwise // 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 *ACLTokenListStub) GetCreateTimeOk() (*time.Time, bool) { - if o == nil || o.CreateTime == nil { + if o == nil { return nil, false } - return o.CreateTime, true + return o.CreateTime.Get(), o.CreateTime.IsSet() } // HasCreateTime returns a boolean if a field has been set. func (o *ACLTokenListStub) HasCreateTime() bool { - if o != nil && o.CreateTime != nil { + if o != nil && o.CreateTime.IsSet() { return true } return false } -// SetCreateTime gets a reference to the given time.Time and assigns it to the CreateTime field. +// SetCreateTime gets a reference to the given NullableTime and assigns it to the CreateTime field. func (o *ACLTokenListStub) SetCreateTime(v time.Time) { - o.CreateTime = &v + o.CreateTime.Set(&v) +} +// SetCreateTimeNil sets the value for CreateTime to be an explicit nil +func (o *ACLTokenListStub) SetCreateTimeNil() { + o.CreateTime.Set(nil) +} + +// UnsetCreateTime ensures that no value is present for CreateTime, not even an explicit nil +func (o *ACLTokenListStub) UnsetCreateTime() { + o.CreateTime.Unset() } // GetGlobal returns the Global field value if set, zero value otherwise. @@ -243,12 +253,12 @@ func (o *ACLTokenListStub) GetPolicies() []string { var ret []string return ret } - return *o.Policies + return o.Policies } // GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ACLTokenListStub) GetPoliciesOk() (*[]string, bool) { +func (o *ACLTokenListStub) GetPoliciesOk() ([]string, bool) { if o == nil || o.Policies == nil { return nil, false } @@ -266,7 +276,7 @@ func (o *ACLTokenListStub) HasPolicies() bool { // SetPolicies gets a reference to the given []string and assigns it to the Policies field. func (o *ACLTokenListStub) SetPolicies(v []string) { - o.Policies = &v + o.Policies = v } // GetType returns the Type field value if set, zero value otherwise. @@ -309,8 +319,8 @@ func (o ACLTokenListStub) MarshalJSON() ([]byte, error) { if o.CreateIndex != nil { toSerialize["CreateIndex"] = o.CreateIndex } - if o.CreateTime != nil { - toSerialize["CreateTime"] = o.CreateTime + if o.CreateTime.IsSet() { + toSerialize["CreateTime"] = o.CreateTime.Get() } if o.Global != nil { toSerialize["Global"] = o.Global diff --git a/clients/go/v1/model_affinity.go b/clients/go/v1/model_affinity.go index 610cac78..e72d54ff 100644 --- a/clients/go/v1/model_affinity.go +++ b/clients/go/v1/model_affinity.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_alloc_deployment_status.go b/clients/go/v1/model_alloc_deployment_status.go index ab0c25d5..6b45fa5a 100644 --- a/clients/go/v1/model_alloc_deployment_status.go +++ b/clients/go/v1/model_alloc_deployment_status.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,7 +21,7 @@ type AllocDeploymentStatus struct { Canary *bool `json:"Canary,omitempty"` Healthy *bool `json:"Healthy,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` - Timestamp *time.Time `json:"Timestamp,omitempty"` + Timestamp NullableTime `json:"Timestamp,omitempty"` } // NewAllocDeploymentStatus instantiates a new AllocDeploymentStatus object @@ -137,36 +137,46 @@ func (o *AllocDeploymentStatus) SetModifyIndex(v int32) { o.ModifyIndex = &v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocDeploymentStatus) GetTimestamp() time.Time { - if o == nil || o.Timestamp == nil { + if o == nil || o.Timestamp.Get() == nil { var ret time.Time return ret } - return *o.Timestamp + return *o.Timestamp.Get() } // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // 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 *AllocDeploymentStatus) GetTimestampOk() (*time.Time, bool) { - if o == nil || o.Timestamp == nil { + if o == nil { return nil, false } - return o.Timestamp, true + return o.Timestamp.Get(), o.Timestamp.IsSet() } // HasTimestamp returns a boolean if a field has been set. func (o *AllocDeploymentStatus) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { + if o != nil && o.Timestamp.IsSet() { return true } return false } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp gets a reference to the given NullableTime and assigns it to the Timestamp field. func (o *AllocDeploymentStatus) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp.Set(&v) +} +// SetTimestampNil sets the value for Timestamp to be an explicit nil +func (o *AllocDeploymentStatus) SetTimestampNil() { + o.Timestamp.Set(nil) +} + +// UnsetTimestamp ensures that no value is present for Timestamp, not even an explicit nil +func (o *AllocDeploymentStatus) UnsetTimestamp() { + o.Timestamp.Unset() } func (o AllocDeploymentStatus) MarshalJSON() ([]byte, error) { @@ -180,8 +190,8 @@ func (o AllocDeploymentStatus) MarshalJSON() ([]byte, error) { if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex } - if o.Timestamp != nil { - toSerialize["Timestamp"] = o.Timestamp + if o.Timestamp.IsSet() { + toSerialize["Timestamp"] = o.Timestamp.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_alloc_stop_response.go b/clients/go/v1/model_alloc_stop_response.go index b5ea3a96..2f1bc29e 100644 --- a/clients/go/v1/model_alloc_stop_response.go +++ b/clients/go/v1/model_alloc_stop_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_allocated_cpu_resources.go b/clients/go/v1/model_allocated_cpu_resources.go index 4dc6c9ee..9fec4a01 100644 --- a/clients/go/v1/model_allocated_cpu_resources.go +++ b/clients/go/v1/model_allocated_cpu_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_allocated_device_resource.go b/clients/go/v1/model_allocated_device_resource.go index e07d3652..e860b7d0 100644 --- a/clients/go/v1/model_allocated_device_resource.go +++ b/clients/go/v1/model_allocated_device_resource.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // AllocatedDeviceResource struct for AllocatedDeviceResource type AllocatedDeviceResource struct { - DeviceIDs *[]string `json:"DeviceIDs,omitempty"` + DeviceIDs []string `json:"DeviceIDs,omitempty"` Name *string `json:"Name,omitempty"` Type *string `json:"Type,omitempty"` Vendor *string `json:"Vendor,omitempty"` @@ -46,12 +46,12 @@ func (o *AllocatedDeviceResource) GetDeviceIDs() []string { var ret []string return ret } - return *o.DeviceIDs + return o.DeviceIDs } // GetDeviceIDsOk returns a tuple with the DeviceIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocatedDeviceResource) GetDeviceIDsOk() (*[]string, bool) { +func (o *AllocatedDeviceResource) GetDeviceIDsOk() ([]string, bool) { if o == nil || o.DeviceIDs == nil { return nil, false } @@ -69,7 +69,7 @@ func (o *AllocatedDeviceResource) HasDeviceIDs() bool { // SetDeviceIDs gets a reference to the given []string and assigns it to the DeviceIDs field. func (o *AllocatedDeviceResource) SetDeviceIDs(v []string) { - o.DeviceIDs = &v + o.DeviceIDs = v } // GetName returns the Name field value if set, zero value otherwise. diff --git a/clients/go/v1/model_allocated_memory_resources.go b/clients/go/v1/model_allocated_memory_resources.go index 5e3f4839..30ab8f09 100644 --- a/clients/go/v1/model_allocated_memory_resources.go +++ b/clients/go/v1/model_allocated_memory_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_allocated_resources.go b/clients/go/v1/model_allocated_resources.go index 1c957aee..a83eb4af 100644 --- a/clients/go/v1/model_allocated_resources.go +++ b/clients/go/v1/model_allocated_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // AllocatedResources struct for AllocatedResources type AllocatedResources struct { - Shared *AllocatedSharedResources `json:"Shared,omitempty"` + Shared NullableAllocatedSharedResources `json:"Shared,omitempty"` Tasks *map[string]AllocatedTaskResources `json:"Tasks,omitempty"` } @@ -38,36 +38,46 @@ func NewAllocatedResourcesWithDefaults() *AllocatedResources { return &this } -// GetShared returns the Shared field value if set, zero value otherwise. +// GetShared returns the Shared field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocatedResources) GetShared() AllocatedSharedResources { - if o == nil || o.Shared == nil { + if o == nil || o.Shared.Get() == nil { var ret AllocatedSharedResources return ret } - return *o.Shared + return *o.Shared.Get() } // GetSharedOk returns a tuple with the Shared field value if set, nil otherwise // 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 *AllocatedResources) GetSharedOk() (*AllocatedSharedResources, bool) { - if o == nil || o.Shared == nil { + if o == nil { return nil, false } - return o.Shared, true + return o.Shared.Get(), o.Shared.IsSet() } // HasShared returns a boolean if a field has been set. func (o *AllocatedResources) HasShared() bool { - if o != nil && o.Shared != nil { + if o != nil && o.Shared.IsSet() { return true } return false } -// SetShared gets a reference to the given AllocatedSharedResources and assigns it to the Shared field. +// SetShared gets a reference to the given NullableAllocatedSharedResources and assigns it to the Shared field. func (o *AllocatedResources) SetShared(v AllocatedSharedResources) { - o.Shared = &v + o.Shared.Set(&v) +} +// SetSharedNil sets the value for Shared to be an explicit nil +func (o *AllocatedResources) SetSharedNil() { + o.Shared.Set(nil) +} + +// UnsetShared ensures that no value is present for Shared, not even an explicit nil +func (o *AllocatedResources) UnsetShared() { + o.Shared.Unset() } // GetTasks returns the Tasks field value if set, zero value otherwise. @@ -104,8 +114,8 @@ func (o *AllocatedResources) SetTasks(v map[string]AllocatedTaskResources) { func (o AllocatedResources) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Shared != nil { - toSerialize["Shared"] = o.Shared + if o.Shared.IsSet() { + toSerialize["Shared"] = o.Shared.Get() } if o.Tasks != nil { toSerialize["Tasks"] = o.Tasks diff --git a/clients/go/v1/model_allocated_shared_resources.go b/clients/go/v1/model_allocated_shared_resources.go index 33b7c83f..ba88b092 100644 --- a/clients/go/v1/model_allocated_shared_resources.go +++ b/clients/go/v1/model_allocated_shared_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,8 +18,8 @@ import ( // AllocatedSharedResources struct for AllocatedSharedResources type AllocatedSharedResources struct { DiskMB *int64 `json:"DiskMB,omitempty"` - Networks *[]NetworkResource `json:"Networks,omitempty"` - Ports *[]PortMapping `json:"Ports,omitempty"` + Networks []NetworkResource `json:"Networks,omitempty"` + Ports []PortMapping `json:"Ports,omitempty"` } // NewAllocatedSharedResources instantiates a new AllocatedSharedResources object @@ -77,12 +77,12 @@ func (o *AllocatedSharedResources) GetNetworks() []NetworkResource { var ret []NetworkResource return ret } - return *o.Networks + return o.Networks } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocatedSharedResources) GetNetworksOk() (*[]NetworkResource, bool) { +func (o *AllocatedSharedResources) GetNetworksOk() ([]NetworkResource, bool) { if o == nil || o.Networks == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *AllocatedSharedResources) HasNetworks() bool { // SetNetworks gets a reference to the given []NetworkResource and assigns it to the Networks field. func (o *AllocatedSharedResources) SetNetworks(v []NetworkResource) { - o.Networks = &v + o.Networks = v } // GetPorts returns the Ports field value if set, zero value otherwise. @@ -109,12 +109,12 @@ func (o *AllocatedSharedResources) GetPorts() []PortMapping { var ret []PortMapping return ret } - return *o.Ports + return o.Ports } // GetPortsOk returns a tuple with the Ports field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocatedSharedResources) GetPortsOk() (*[]PortMapping, bool) { +func (o *AllocatedSharedResources) GetPortsOk() ([]PortMapping, bool) { if o == nil || o.Ports == nil { return nil, false } @@ -132,7 +132,7 @@ func (o *AllocatedSharedResources) HasPorts() bool { // SetPorts gets a reference to the given []PortMapping and assigns it to the Ports field. func (o *AllocatedSharedResources) SetPorts(v []PortMapping) { - o.Ports = &v + o.Ports = v } func (o AllocatedSharedResources) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_allocated_task_resources.go b/clients/go/v1/model_allocated_task_resources.go index c4a774cd..576c9a49 100644 --- a/clients/go/v1/model_allocated_task_resources.go +++ b/clients/go/v1/model_allocated_task_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // AllocatedTaskResources struct for AllocatedTaskResources type AllocatedTaskResources struct { - Cpu *AllocatedCpuResources `json:"Cpu,omitempty"` - Devices *[]AllocatedDeviceResource `json:"Devices,omitempty"` - Memory *AllocatedMemoryResources `json:"Memory,omitempty"` - Networks *[]NetworkResource `json:"Networks,omitempty"` + Cpu NullableAllocatedCpuResources `json:"Cpu,omitempty"` + Devices []AllocatedDeviceResource `json:"Devices,omitempty"` + Memory NullableAllocatedMemoryResources `json:"Memory,omitempty"` + Networks []NetworkResource `json:"Networks,omitempty"` } // NewAllocatedTaskResources instantiates a new AllocatedTaskResources object @@ -40,36 +40,46 @@ func NewAllocatedTaskResourcesWithDefaults() *AllocatedTaskResources { return &this } -// GetCpu returns the Cpu field value if set, zero value otherwise. +// GetCpu returns the Cpu field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocatedTaskResources) GetCpu() AllocatedCpuResources { - if o == nil || o.Cpu == nil { + if o == nil || o.Cpu.Get() == nil { var ret AllocatedCpuResources return ret } - return *o.Cpu + return *o.Cpu.Get() } // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise // 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 *AllocatedTaskResources) GetCpuOk() (*AllocatedCpuResources, bool) { - if o == nil || o.Cpu == nil { + if o == nil { return nil, false } - return o.Cpu, true + return o.Cpu.Get(), o.Cpu.IsSet() } // HasCpu returns a boolean if a field has been set. func (o *AllocatedTaskResources) HasCpu() bool { - if o != nil && o.Cpu != nil { + if o != nil && o.Cpu.IsSet() { return true } return false } -// SetCpu gets a reference to the given AllocatedCpuResources and assigns it to the Cpu field. +// SetCpu gets a reference to the given NullableAllocatedCpuResources and assigns it to the Cpu field. func (o *AllocatedTaskResources) SetCpu(v AllocatedCpuResources) { - o.Cpu = &v + o.Cpu.Set(&v) +} +// SetCpuNil sets the value for Cpu to be an explicit nil +func (o *AllocatedTaskResources) SetCpuNil() { + o.Cpu.Set(nil) +} + +// UnsetCpu ensures that no value is present for Cpu, not even an explicit nil +func (o *AllocatedTaskResources) UnsetCpu() { + o.Cpu.Unset() } // GetDevices returns the Devices field value if set, zero value otherwise. @@ -78,12 +88,12 @@ func (o *AllocatedTaskResources) GetDevices() []AllocatedDeviceResource { var ret []AllocatedDeviceResource return ret } - return *o.Devices + return o.Devices } // GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocatedTaskResources) GetDevicesOk() (*[]AllocatedDeviceResource, bool) { +func (o *AllocatedTaskResources) GetDevicesOk() ([]AllocatedDeviceResource, bool) { if o == nil || o.Devices == nil { return nil, false } @@ -101,39 +111,49 @@ func (o *AllocatedTaskResources) HasDevices() bool { // SetDevices gets a reference to the given []AllocatedDeviceResource and assigns it to the Devices field. func (o *AllocatedTaskResources) SetDevices(v []AllocatedDeviceResource) { - o.Devices = &v + o.Devices = v } -// GetMemory returns the Memory field value if set, zero value otherwise. +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocatedTaskResources) GetMemory() AllocatedMemoryResources { - if o == nil || o.Memory == nil { + if o == nil || o.Memory.Get() == nil { var ret AllocatedMemoryResources return ret } - return *o.Memory + return *o.Memory.Get() } // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise // 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 *AllocatedTaskResources) GetMemoryOk() (*AllocatedMemoryResources, bool) { - if o == nil || o.Memory == nil { + if o == nil { return nil, false } - return o.Memory, true + return o.Memory.Get(), o.Memory.IsSet() } // HasMemory returns a boolean if a field has been set. func (o *AllocatedTaskResources) HasMemory() bool { - if o != nil && o.Memory != nil { + if o != nil && o.Memory.IsSet() { return true } return false } -// SetMemory gets a reference to the given AllocatedMemoryResources and assigns it to the Memory field. +// SetMemory gets a reference to the given NullableAllocatedMemoryResources and assigns it to the Memory field. func (o *AllocatedTaskResources) SetMemory(v AllocatedMemoryResources) { - o.Memory = &v + o.Memory.Set(&v) +} +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *AllocatedTaskResources) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *AllocatedTaskResources) UnsetMemory() { + o.Memory.Unset() } // GetNetworks returns the Networks field value if set, zero value otherwise. @@ -142,12 +162,12 @@ func (o *AllocatedTaskResources) GetNetworks() []NetworkResource { var ret []NetworkResource return ret } - return *o.Networks + return o.Networks } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocatedTaskResources) GetNetworksOk() (*[]NetworkResource, bool) { +func (o *AllocatedTaskResources) GetNetworksOk() ([]NetworkResource, bool) { if o == nil || o.Networks == nil { return nil, false } @@ -165,19 +185,19 @@ func (o *AllocatedTaskResources) HasNetworks() bool { // SetNetworks gets a reference to the given []NetworkResource and assigns it to the Networks field. func (o *AllocatedTaskResources) SetNetworks(v []NetworkResource) { - o.Networks = &v + o.Networks = v } func (o AllocatedTaskResources) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Cpu != nil { - toSerialize["Cpu"] = o.Cpu + if o.Cpu.IsSet() { + toSerialize["Cpu"] = o.Cpu.Get() } if o.Devices != nil { toSerialize["Devices"] = o.Devices } - if o.Memory != nil { - toSerialize["Memory"] = o.Memory + if o.Memory.IsSet() { + toSerialize["Memory"] = o.Memory.Get() } if o.Networks != nil { toSerialize["Networks"] = o.Networks diff --git a/clients/go/v1/model_allocation.go b/clients/go/v1/model_allocation.go index fa57f830..27f1a286 100644 --- a/clients/go/v1/model_allocation.go +++ b/clients/go/v1/model_allocation.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,22 +18,22 @@ import ( // Allocation struct for Allocation type Allocation struct { AllocModifyIndex *int32 `json:"AllocModifyIndex,omitempty"` - AllocatedResources *AllocatedResources `json:"AllocatedResources,omitempty"` + AllocatedResources NullableAllocatedResources `json:"AllocatedResources,omitempty"` ClientDescription *string `json:"ClientDescription,omitempty"` ClientStatus *string `json:"ClientStatus,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` CreateTime *int64 `json:"CreateTime,omitempty"` DeploymentID *string `json:"DeploymentID,omitempty"` - DeploymentStatus *AllocDeploymentStatus `json:"DeploymentStatus,omitempty"` + DeploymentStatus NullableAllocDeploymentStatus `json:"DeploymentStatus,omitempty"` DesiredDescription *string `json:"DesiredDescription,omitempty"` DesiredStatus *string `json:"DesiredStatus,omitempty"` DesiredTransition *DesiredTransition `json:"DesiredTransition,omitempty"` EvalID *string `json:"EvalID,omitempty"` FollowupEvalID *string `json:"FollowupEvalID,omitempty"` ID *string `json:"ID,omitempty"` - Job *Job `json:"Job,omitempty"` + Job NullableJob `json:"Job,omitempty"` JobID *string `json:"JobID,omitempty"` - Metrics *AllocationMetric `json:"Metrics,omitempty"` + Metrics NullableAllocationMetric `json:"Metrics,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` ModifyTime *int64 `json:"ModifyTime,omitempty"` Name *string `json:"Name,omitempty"` @@ -41,11 +41,11 @@ type Allocation struct { NextAllocation *string `json:"NextAllocation,omitempty"` NodeID *string `json:"NodeID,omitempty"` NodeName *string `json:"NodeName,omitempty"` - PreemptedAllocations *[]string `json:"PreemptedAllocations,omitempty"` + PreemptedAllocations []string `json:"PreemptedAllocations,omitempty"` PreemptedByAllocation *string `json:"PreemptedByAllocation,omitempty"` PreviousAllocation *string `json:"PreviousAllocation,omitempty"` - RescheduleTracker *RescheduleTracker `json:"RescheduleTracker,omitempty"` - Resources *Resources `json:"Resources,omitempty"` + RescheduleTracker NullableRescheduleTracker `json:"RescheduleTracker,omitempty"` + Resources NullableResources `json:"Resources,omitempty"` Services *map[string]string `json:"Services,omitempty"` TaskGroup *string `json:"TaskGroup,omitempty"` TaskResources *map[string]Resources `json:"TaskResources,omitempty"` @@ -101,36 +101,46 @@ func (o *Allocation) SetAllocModifyIndex(v int32) { o.AllocModifyIndex = &v } -// GetAllocatedResources returns the AllocatedResources field value if set, zero value otherwise. +// GetAllocatedResources returns the AllocatedResources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Allocation) GetAllocatedResources() AllocatedResources { - if o == nil || o.AllocatedResources == nil { + if o == nil || o.AllocatedResources.Get() == nil { var ret AllocatedResources return ret } - return *o.AllocatedResources + return *o.AllocatedResources.Get() } // GetAllocatedResourcesOk returns a tuple with the AllocatedResources field value if set, nil otherwise // 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 *Allocation) GetAllocatedResourcesOk() (*AllocatedResources, bool) { - if o == nil || o.AllocatedResources == nil { + if o == nil { return nil, false } - return o.AllocatedResources, true + return o.AllocatedResources.Get(), o.AllocatedResources.IsSet() } // HasAllocatedResources returns a boolean if a field has been set. func (o *Allocation) HasAllocatedResources() bool { - if o != nil && o.AllocatedResources != nil { + if o != nil && o.AllocatedResources.IsSet() { return true } return false } -// SetAllocatedResources gets a reference to the given AllocatedResources and assigns it to the AllocatedResources field. +// SetAllocatedResources gets a reference to the given NullableAllocatedResources and assigns it to the AllocatedResources field. func (o *Allocation) SetAllocatedResources(v AllocatedResources) { - o.AllocatedResources = &v + o.AllocatedResources.Set(&v) +} +// SetAllocatedResourcesNil sets the value for AllocatedResources to be an explicit nil +func (o *Allocation) SetAllocatedResourcesNil() { + o.AllocatedResources.Set(nil) +} + +// UnsetAllocatedResources ensures that no value is present for AllocatedResources, not even an explicit nil +func (o *Allocation) UnsetAllocatedResources() { + o.AllocatedResources.Unset() } // GetClientDescription returns the ClientDescription field value if set, zero value otherwise. @@ -293,36 +303,46 @@ func (o *Allocation) SetDeploymentID(v string) { o.DeploymentID = &v } -// GetDeploymentStatus returns the DeploymentStatus field value if set, zero value otherwise. +// GetDeploymentStatus returns the DeploymentStatus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Allocation) GetDeploymentStatus() AllocDeploymentStatus { - if o == nil || o.DeploymentStatus == nil { + if o == nil || o.DeploymentStatus.Get() == nil { var ret AllocDeploymentStatus return ret } - return *o.DeploymentStatus + return *o.DeploymentStatus.Get() } // GetDeploymentStatusOk returns a tuple with the DeploymentStatus field value if set, nil otherwise // 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 *Allocation) GetDeploymentStatusOk() (*AllocDeploymentStatus, bool) { - if o == nil || o.DeploymentStatus == nil { + if o == nil { return nil, false } - return o.DeploymentStatus, true + return o.DeploymentStatus.Get(), o.DeploymentStatus.IsSet() } // HasDeploymentStatus returns a boolean if a field has been set. func (o *Allocation) HasDeploymentStatus() bool { - if o != nil && o.DeploymentStatus != nil { + if o != nil && o.DeploymentStatus.IsSet() { return true } return false } -// SetDeploymentStatus gets a reference to the given AllocDeploymentStatus and assigns it to the DeploymentStatus field. +// SetDeploymentStatus gets a reference to the given NullableAllocDeploymentStatus and assigns it to the DeploymentStatus field. func (o *Allocation) SetDeploymentStatus(v AllocDeploymentStatus) { - o.DeploymentStatus = &v + o.DeploymentStatus.Set(&v) +} +// SetDeploymentStatusNil sets the value for DeploymentStatus to be an explicit nil +func (o *Allocation) SetDeploymentStatusNil() { + o.DeploymentStatus.Set(nil) +} + +// UnsetDeploymentStatus ensures that no value is present for DeploymentStatus, not even an explicit nil +func (o *Allocation) UnsetDeploymentStatus() { + o.DeploymentStatus.Unset() } // GetDesiredDescription returns the DesiredDescription field value if set, zero value otherwise. @@ -517,36 +537,46 @@ func (o *Allocation) SetID(v string) { o.ID = &v } -// GetJob returns the Job field value if set, zero value otherwise. +// GetJob returns the Job field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Allocation) GetJob() Job { - if o == nil || o.Job == nil { + if o == nil || o.Job.Get() == nil { var ret Job return ret } - return *o.Job + return *o.Job.Get() } // GetJobOk returns a tuple with the Job field value if set, nil otherwise // 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 *Allocation) GetJobOk() (*Job, bool) { - if o == nil || o.Job == nil { + if o == nil { return nil, false } - return o.Job, true + return o.Job.Get(), o.Job.IsSet() } // HasJob returns a boolean if a field has been set. func (o *Allocation) HasJob() bool { - if o != nil && o.Job != nil { + if o != nil && o.Job.IsSet() { return true } return false } -// SetJob gets a reference to the given Job and assigns it to the Job field. +// SetJob gets a reference to the given NullableJob and assigns it to the Job field. func (o *Allocation) SetJob(v Job) { - o.Job = &v + o.Job.Set(&v) +} +// SetJobNil sets the value for Job to be an explicit nil +func (o *Allocation) SetJobNil() { + o.Job.Set(nil) +} + +// UnsetJob ensures that no value is present for Job, not even an explicit nil +func (o *Allocation) UnsetJob() { + o.Job.Unset() } // GetJobID returns the JobID field value if set, zero value otherwise. @@ -581,36 +611,46 @@ func (o *Allocation) SetJobID(v string) { o.JobID = &v } -// GetMetrics returns the Metrics field value if set, zero value otherwise. +// GetMetrics returns the Metrics field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Allocation) GetMetrics() AllocationMetric { - if o == nil || o.Metrics == nil { + if o == nil || o.Metrics.Get() == nil { var ret AllocationMetric return ret } - return *o.Metrics + return *o.Metrics.Get() } // GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise // 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 *Allocation) GetMetricsOk() (*AllocationMetric, bool) { - if o == nil || o.Metrics == nil { + if o == nil { return nil, false } - return o.Metrics, true + return o.Metrics.Get(), o.Metrics.IsSet() } // HasMetrics returns a boolean if a field has been set. func (o *Allocation) HasMetrics() bool { - if o != nil && o.Metrics != nil { + if o != nil && o.Metrics.IsSet() { return true } return false } -// SetMetrics gets a reference to the given AllocationMetric and assigns it to the Metrics field. +// SetMetrics gets a reference to the given NullableAllocationMetric and assigns it to the Metrics field. func (o *Allocation) SetMetrics(v AllocationMetric) { - o.Metrics = &v + o.Metrics.Set(&v) +} +// SetMetricsNil sets the value for Metrics to be an explicit nil +func (o *Allocation) SetMetricsNil() { + o.Metrics.Set(nil) +} + +// UnsetMetrics ensures that no value is present for Metrics, not even an explicit nil +func (o *Allocation) UnsetMetrics() { + o.Metrics.Unset() } // GetModifyIndex returns the ModifyIndex field value if set, zero value otherwise. @@ -843,12 +883,12 @@ func (o *Allocation) GetPreemptedAllocations() []string { var ret []string return ret } - return *o.PreemptedAllocations + return o.PreemptedAllocations } // GetPreemptedAllocationsOk returns a tuple with the PreemptedAllocations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Allocation) GetPreemptedAllocationsOk() (*[]string, bool) { +func (o *Allocation) GetPreemptedAllocationsOk() ([]string, bool) { if o == nil || o.PreemptedAllocations == nil { return nil, false } @@ -866,7 +906,7 @@ func (o *Allocation) HasPreemptedAllocations() bool { // SetPreemptedAllocations gets a reference to the given []string and assigns it to the PreemptedAllocations field. func (o *Allocation) SetPreemptedAllocations(v []string) { - o.PreemptedAllocations = &v + o.PreemptedAllocations = v } // GetPreemptedByAllocation returns the PreemptedByAllocation field value if set, zero value otherwise. @@ -933,68 +973,88 @@ func (o *Allocation) SetPreviousAllocation(v string) { o.PreviousAllocation = &v } -// GetRescheduleTracker returns the RescheduleTracker field value if set, zero value otherwise. +// GetRescheduleTracker returns the RescheduleTracker field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Allocation) GetRescheduleTracker() RescheduleTracker { - if o == nil || o.RescheduleTracker == nil { + if o == nil || o.RescheduleTracker.Get() == nil { var ret RescheduleTracker return ret } - return *o.RescheduleTracker + return *o.RescheduleTracker.Get() } // GetRescheduleTrackerOk returns a tuple with the RescheduleTracker field value if set, nil otherwise // 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 *Allocation) GetRescheduleTrackerOk() (*RescheduleTracker, bool) { - if o == nil || o.RescheduleTracker == nil { + if o == nil { return nil, false } - return o.RescheduleTracker, true + return o.RescheduleTracker.Get(), o.RescheduleTracker.IsSet() } // HasRescheduleTracker returns a boolean if a field has been set. func (o *Allocation) HasRescheduleTracker() bool { - if o != nil && o.RescheduleTracker != nil { + if o != nil && o.RescheduleTracker.IsSet() { return true } return false } -// SetRescheduleTracker gets a reference to the given RescheduleTracker and assigns it to the RescheduleTracker field. +// SetRescheduleTracker gets a reference to the given NullableRescheduleTracker and assigns it to the RescheduleTracker field. func (o *Allocation) SetRescheduleTracker(v RescheduleTracker) { - o.RescheduleTracker = &v + o.RescheduleTracker.Set(&v) +} +// SetRescheduleTrackerNil sets the value for RescheduleTracker to be an explicit nil +func (o *Allocation) SetRescheduleTrackerNil() { + o.RescheduleTracker.Set(nil) } -// GetResources returns the Resources field value if set, zero value otherwise. +// UnsetRescheduleTracker ensures that no value is present for RescheduleTracker, not even an explicit nil +func (o *Allocation) UnsetRescheduleTracker() { + o.RescheduleTracker.Unset() +} + +// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Allocation) GetResources() Resources { - if o == nil || o.Resources == nil { + if o == nil || o.Resources.Get() == nil { var ret Resources return ret } - return *o.Resources + return *o.Resources.Get() } // GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise // 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 *Allocation) GetResourcesOk() (*Resources, bool) { - if o == nil || o.Resources == nil { + if o == nil { return nil, false } - return o.Resources, true + return o.Resources.Get(), o.Resources.IsSet() } // HasResources returns a boolean if a field has been set. func (o *Allocation) HasResources() bool { - if o != nil && o.Resources != nil { + if o != nil && o.Resources.IsSet() { return true } return false } -// SetResources gets a reference to the given Resources and assigns it to the Resources field. +// SetResources gets a reference to the given NullableResources and assigns it to the Resources field. func (o *Allocation) SetResources(v Resources) { - o.Resources = &v + o.Resources.Set(&v) +} +// SetResourcesNil sets the value for Resources to be an explicit nil +func (o *Allocation) SetResourcesNil() { + o.Resources.Set(nil) +} + +// UnsetResources ensures that no value is present for Resources, not even an explicit nil +func (o *Allocation) UnsetResources() { + o.Resources.Unset() } // GetServices returns the Services field value if set, zero value otherwise. @@ -1130,8 +1190,8 @@ func (o Allocation) MarshalJSON() ([]byte, error) { if o.AllocModifyIndex != nil { toSerialize["AllocModifyIndex"] = o.AllocModifyIndex } - if o.AllocatedResources != nil { - toSerialize["AllocatedResources"] = o.AllocatedResources + if o.AllocatedResources.IsSet() { + toSerialize["AllocatedResources"] = o.AllocatedResources.Get() } if o.ClientDescription != nil { toSerialize["ClientDescription"] = o.ClientDescription @@ -1148,8 +1208,8 @@ func (o Allocation) MarshalJSON() ([]byte, error) { if o.DeploymentID != nil { toSerialize["DeploymentID"] = o.DeploymentID } - if o.DeploymentStatus != nil { - toSerialize["DeploymentStatus"] = o.DeploymentStatus + if o.DeploymentStatus.IsSet() { + toSerialize["DeploymentStatus"] = o.DeploymentStatus.Get() } if o.DesiredDescription != nil { toSerialize["DesiredDescription"] = o.DesiredDescription @@ -1169,14 +1229,14 @@ func (o Allocation) MarshalJSON() ([]byte, error) { if o.ID != nil { toSerialize["ID"] = o.ID } - if o.Job != nil { - toSerialize["Job"] = o.Job + if o.Job.IsSet() { + toSerialize["Job"] = o.Job.Get() } if o.JobID != nil { toSerialize["JobID"] = o.JobID } - if o.Metrics != nil { - toSerialize["Metrics"] = o.Metrics + if o.Metrics.IsSet() { + toSerialize["Metrics"] = o.Metrics.Get() } if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex @@ -1208,11 +1268,11 @@ func (o Allocation) MarshalJSON() ([]byte, error) { if o.PreviousAllocation != nil { toSerialize["PreviousAllocation"] = o.PreviousAllocation } - if o.RescheduleTracker != nil { - toSerialize["RescheduleTracker"] = o.RescheduleTracker + if o.RescheduleTracker.IsSet() { + toSerialize["RescheduleTracker"] = o.RescheduleTracker.Get() } - if o.Resources != nil { - toSerialize["Resources"] = o.Resources + if o.Resources.IsSet() { + toSerialize["Resources"] = o.Resources.Get() } if o.Services != nil { toSerialize["Services"] = o.Services diff --git a/clients/go/v1/model_allocation_list_stub.go b/clients/go/v1/model_allocation_list_stub.go index 47871337..2a4573aa 100644 --- a/clients/go/v1/model_allocation_list_stub.go +++ b/clients/go/v1/model_allocation_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,12 +17,12 @@ import ( // AllocationListStub struct for AllocationListStub type AllocationListStub struct { - AllocatedResources *AllocatedResources `json:"AllocatedResources,omitempty"` + AllocatedResources NullableAllocatedResources `json:"AllocatedResources,omitempty"` ClientDescription *string `json:"ClientDescription,omitempty"` ClientStatus *string `json:"ClientStatus,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` CreateTime *int64 `json:"CreateTime,omitempty"` - DeploymentStatus *AllocDeploymentStatus `json:"DeploymentStatus,omitempty"` + DeploymentStatus NullableAllocDeploymentStatus `json:"DeploymentStatus,omitempty"` DesiredDescription *string `json:"DesiredDescription,omitempty"` DesiredStatus *string `json:"DesiredStatus,omitempty"` EvalID *string `json:"EvalID,omitempty"` @@ -37,9 +37,9 @@ type AllocationListStub struct { Namespace *string `json:"Namespace,omitempty"` NodeID *string `json:"NodeID,omitempty"` NodeName *string `json:"NodeName,omitempty"` - PreemptedAllocations *[]string `json:"PreemptedAllocations,omitempty"` + PreemptedAllocations []string `json:"PreemptedAllocations,omitempty"` PreemptedByAllocation *string `json:"PreemptedByAllocation,omitempty"` - RescheduleTracker *RescheduleTracker `json:"RescheduleTracker,omitempty"` + RescheduleTracker NullableRescheduleTracker `json:"RescheduleTracker,omitempty"` TaskGroup *string `json:"TaskGroup,omitempty"` TaskStates *map[string]TaskState `json:"TaskStates,omitempty"` } @@ -61,36 +61,46 @@ func NewAllocationListStubWithDefaults() *AllocationListStub { return &this } -// GetAllocatedResources returns the AllocatedResources field value if set, zero value otherwise. +// GetAllocatedResources returns the AllocatedResources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocationListStub) GetAllocatedResources() AllocatedResources { - if o == nil || o.AllocatedResources == nil { + if o == nil || o.AllocatedResources.Get() == nil { var ret AllocatedResources return ret } - return *o.AllocatedResources + return *o.AllocatedResources.Get() } // GetAllocatedResourcesOk returns a tuple with the AllocatedResources field value if set, nil otherwise // 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 *AllocationListStub) GetAllocatedResourcesOk() (*AllocatedResources, bool) { - if o == nil || o.AllocatedResources == nil { + if o == nil { return nil, false } - return o.AllocatedResources, true + return o.AllocatedResources.Get(), o.AllocatedResources.IsSet() } // HasAllocatedResources returns a boolean if a field has been set. func (o *AllocationListStub) HasAllocatedResources() bool { - if o != nil && o.AllocatedResources != nil { + if o != nil && o.AllocatedResources.IsSet() { return true } return false } -// SetAllocatedResources gets a reference to the given AllocatedResources and assigns it to the AllocatedResources field. +// SetAllocatedResources gets a reference to the given NullableAllocatedResources and assigns it to the AllocatedResources field. func (o *AllocationListStub) SetAllocatedResources(v AllocatedResources) { - o.AllocatedResources = &v + o.AllocatedResources.Set(&v) +} +// SetAllocatedResourcesNil sets the value for AllocatedResources to be an explicit nil +func (o *AllocationListStub) SetAllocatedResourcesNil() { + o.AllocatedResources.Set(nil) +} + +// UnsetAllocatedResources ensures that no value is present for AllocatedResources, not even an explicit nil +func (o *AllocationListStub) UnsetAllocatedResources() { + o.AllocatedResources.Unset() } // GetClientDescription returns the ClientDescription field value if set, zero value otherwise. @@ -221,36 +231,46 @@ func (o *AllocationListStub) SetCreateTime(v int64) { o.CreateTime = &v } -// GetDeploymentStatus returns the DeploymentStatus field value if set, zero value otherwise. +// GetDeploymentStatus returns the DeploymentStatus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocationListStub) GetDeploymentStatus() AllocDeploymentStatus { - if o == nil || o.DeploymentStatus == nil { + if o == nil || o.DeploymentStatus.Get() == nil { var ret AllocDeploymentStatus return ret } - return *o.DeploymentStatus + return *o.DeploymentStatus.Get() } // GetDeploymentStatusOk returns a tuple with the DeploymentStatus field value if set, nil otherwise // 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 *AllocationListStub) GetDeploymentStatusOk() (*AllocDeploymentStatus, bool) { - if o == nil || o.DeploymentStatus == nil { + if o == nil { return nil, false } - return o.DeploymentStatus, true + return o.DeploymentStatus.Get(), o.DeploymentStatus.IsSet() } // HasDeploymentStatus returns a boolean if a field has been set. func (o *AllocationListStub) HasDeploymentStatus() bool { - if o != nil && o.DeploymentStatus != nil { + if o != nil && o.DeploymentStatus.IsSet() { return true } return false } -// SetDeploymentStatus gets a reference to the given AllocDeploymentStatus and assigns it to the DeploymentStatus field. +// SetDeploymentStatus gets a reference to the given NullableAllocDeploymentStatus and assigns it to the DeploymentStatus field. func (o *AllocationListStub) SetDeploymentStatus(v AllocDeploymentStatus) { - o.DeploymentStatus = &v + o.DeploymentStatus.Set(&v) +} +// SetDeploymentStatusNil sets the value for DeploymentStatus to be an explicit nil +func (o *AllocationListStub) SetDeploymentStatusNil() { + o.DeploymentStatus.Set(nil) +} + +// UnsetDeploymentStatus ensures that no value is present for DeploymentStatus, not even an explicit nil +func (o *AllocationListStub) UnsetDeploymentStatus() { + o.DeploymentStatus.Unset() } // GetDesiredDescription returns the DesiredDescription field value if set, zero value otherwise. @@ -707,12 +727,12 @@ func (o *AllocationListStub) GetPreemptedAllocations() []string { var ret []string return ret } - return *o.PreemptedAllocations + return o.PreemptedAllocations } // GetPreemptedAllocationsOk returns a tuple with the PreemptedAllocations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocationListStub) GetPreemptedAllocationsOk() (*[]string, bool) { +func (o *AllocationListStub) GetPreemptedAllocationsOk() ([]string, bool) { if o == nil || o.PreemptedAllocations == nil { return nil, false } @@ -730,7 +750,7 @@ func (o *AllocationListStub) HasPreemptedAllocations() bool { // SetPreemptedAllocations gets a reference to the given []string and assigns it to the PreemptedAllocations field. func (o *AllocationListStub) SetPreemptedAllocations(v []string) { - o.PreemptedAllocations = &v + o.PreemptedAllocations = v } // GetPreemptedByAllocation returns the PreemptedByAllocation field value if set, zero value otherwise. @@ -765,36 +785,46 @@ func (o *AllocationListStub) SetPreemptedByAllocation(v string) { o.PreemptedByAllocation = &v } -// GetRescheduleTracker returns the RescheduleTracker field value if set, zero value otherwise. +// GetRescheduleTracker returns the RescheduleTracker field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AllocationListStub) GetRescheduleTracker() RescheduleTracker { - if o == nil || o.RescheduleTracker == nil { + if o == nil || o.RescheduleTracker.Get() == nil { var ret RescheduleTracker return ret } - return *o.RescheduleTracker + return *o.RescheduleTracker.Get() } // GetRescheduleTrackerOk returns a tuple with the RescheduleTracker field value if set, nil otherwise // 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 *AllocationListStub) GetRescheduleTrackerOk() (*RescheduleTracker, bool) { - if o == nil || o.RescheduleTracker == nil { + if o == nil { return nil, false } - return o.RescheduleTracker, true + return o.RescheduleTracker.Get(), o.RescheduleTracker.IsSet() } // HasRescheduleTracker returns a boolean if a field has been set. func (o *AllocationListStub) HasRescheduleTracker() bool { - if o != nil && o.RescheduleTracker != nil { + if o != nil && o.RescheduleTracker.IsSet() { return true } return false } -// SetRescheduleTracker gets a reference to the given RescheduleTracker and assigns it to the RescheduleTracker field. +// SetRescheduleTracker gets a reference to the given NullableRescheduleTracker and assigns it to the RescheduleTracker field. func (o *AllocationListStub) SetRescheduleTracker(v RescheduleTracker) { - o.RescheduleTracker = &v + o.RescheduleTracker.Set(&v) +} +// SetRescheduleTrackerNil sets the value for RescheduleTracker to be an explicit nil +func (o *AllocationListStub) SetRescheduleTrackerNil() { + o.RescheduleTracker.Set(nil) +} + +// UnsetRescheduleTracker ensures that no value is present for RescheduleTracker, not even an explicit nil +func (o *AllocationListStub) UnsetRescheduleTracker() { + o.RescheduleTracker.Unset() } // GetTaskGroup returns the TaskGroup field value if set, zero value otherwise. @@ -863,8 +893,8 @@ func (o *AllocationListStub) SetTaskStates(v map[string]TaskState) { func (o AllocationListStub) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AllocatedResources != nil { - toSerialize["AllocatedResources"] = o.AllocatedResources + if o.AllocatedResources.IsSet() { + toSerialize["AllocatedResources"] = o.AllocatedResources.Get() } if o.ClientDescription != nil { toSerialize["ClientDescription"] = o.ClientDescription @@ -878,8 +908,8 @@ func (o AllocationListStub) MarshalJSON() ([]byte, error) { if o.CreateTime != nil { toSerialize["CreateTime"] = o.CreateTime } - if o.DeploymentStatus != nil { - toSerialize["DeploymentStatus"] = o.DeploymentStatus + if o.DeploymentStatus.IsSet() { + toSerialize["DeploymentStatus"] = o.DeploymentStatus.Get() } if o.DesiredDescription != nil { toSerialize["DesiredDescription"] = o.DesiredDescription @@ -929,8 +959,8 @@ func (o AllocationListStub) MarshalJSON() ([]byte, error) { if o.PreemptedByAllocation != nil { toSerialize["PreemptedByAllocation"] = o.PreemptedByAllocation } - if o.RescheduleTracker != nil { - toSerialize["RescheduleTracker"] = o.RescheduleTracker + if o.RescheduleTracker.IsSet() { + toSerialize["RescheduleTracker"] = o.RescheduleTracker.Get() } if o.TaskGroup != nil { toSerialize["TaskGroup"] = o.TaskGroup diff --git a/clients/go/v1/model_allocation_metric.go b/clients/go/v1/model_allocation_metric.go index c8e05cb6..7485b7b2 100644 --- a/clients/go/v1/model_allocation_metric.go +++ b/clients/go/v1/model_allocation_metric.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -27,9 +27,9 @@ type AllocationMetric struct { NodesEvaluated *int32 `json:"NodesEvaluated,omitempty"` NodesExhausted *int32 `json:"NodesExhausted,omitempty"` NodesFiltered *int32 `json:"NodesFiltered,omitempty"` - QuotaExhausted *[]string `json:"QuotaExhausted,omitempty"` + QuotaExhausted []string `json:"QuotaExhausted,omitempty"` ResourcesExhausted *map[string]Resources `json:"ResourcesExhausted,omitempty"` - ScoreMetaData *[]NodeScoreMeta `json:"ScoreMetaData,omitempty"` + ScoreMetaData []NodeScoreMeta `json:"ScoreMetaData,omitempty"` Scores *map[string]float64 `json:"Scores,omitempty"` } @@ -376,12 +376,12 @@ func (o *AllocationMetric) GetQuotaExhausted() []string { var ret []string return ret } - return *o.QuotaExhausted + return o.QuotaExhausted } // GetQuotaExhaustedOk returns a tuple with the QuotaExhausted field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocationMetric) GetQuotaExhaustedOk() (*[]string, bool) { +func (o *AllocationMetric) GetQuotaExhaustedOk() ([]string, bool) { if o == nil || o.QuotaExhausted == nil { return nil, false } @@ -399,7 +399,7 @@ func (o *AllocationMetric) HasQuotaExhausted() bool { // SetQuotaExhausted gets a reference to the given []string and assigns it to the QuotaExhausted field. func (o *AllocationMetric) SetQuotaExhausted(v []string) { - o.QuotaExhausted = &v + o.QuotaExhausted = v } // GetResourcesExhausted returns the ResourcesExhausted field value if set, zero value otherwise. @@ -440,12 +440,12 @@ func (o *AllocationMetric) GetScoreMetaData() []NodeScoreMeta { var ret []NodeScoreMeta return ret } - return *o.ScoreMetaData + return o.ScoreMetaData } // GetScoreMetaDataOk returns a tuple with the ScoreMetaData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AllocationMetric) GetScoreMetaDataOk() (*[]NodeScoreMeta, bool) { +func (o *AllocationMetric) GetScoreMetaDataOk() ([]NodeScoreMeta, bool) { if o == nil || o.ScoreMetaData == nil { return nil, false } @@ -463,7 +463,7 @@ func (o *AllocationMetric) HasScoreMetaData() bool { // SetScoreMetaData gets a reference to the given []NodeScoreMeta and assigns it to the ScoreMetaData field. func (o *AllocationMetric) SetScoreMetaData(v []NodeScoreMeta) { - o.ScoreMetaData = &v + o.ScoreMetaData = v } // GetScores returns the Scores field value if set, zero value otherwise. diff --git a/clients/go/v1/model_attribute.go b/clients/go/v1/model_attribute.go index 798bada1..8b6f4afd 100644 --- a/clients/go/v1/model_attribute.go +++ b/clients/go/v1/model_attribute.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_autopilot_configuration.go b/clients/go/v1/model_autopilot_configuration.go index 0714685d..2f33d5cd 100644 --- a/clients/go/v1/model_autopilot_configuration.go +++ b/clients/go/v1/model_autopilot_configuration.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_check_restart.go b/clients/go/v1/model_check_restart.go index cc85a35b..ba0ed156 100644 --- a/clients/go/v1/model_check_restart.go +++ b/clients/go/v1/model_check_restart.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_constraint.go b/clients/go/v1/model_constraint.go index 5bb27127..2142e965 100644 --- a/clients/go/v1/model_constraint.go +++ b/clients/go/v1/model_constraint.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul.go b/clients/go/v1/model_consul.go index 9d7156f8..aea03031 100644 --- a/clients/go/v1/model_consul.go +++ b/clients/go/v1/model_consul.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul_connect.go b/clients/go/v1/model_consul_connect.go index dcb2c225..7083f9dd 100644 --- a/clients/go/v1/model_consul_connect.go +++ b/clients/go/v1/model_consul_connect.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ import ( type ConsulConnect struct { Gateway *ConsulGateway `json:"Gateway,omitempty"` Native *bool `json:"Native,omitempty"` - SidecarService *ConsulSidecarService `json:"SidecarService,omitempty"` - SidecarTask *SidecarTask `json:"SidecarTask,omitempty"` + SidecarService NullableConsulSidecarService `json:"SidecarService,omitempty"` + SidecarTask NullableSidecarTask `json:"SidecarTask,omitempty"` } // NewConsulConnect instantiates a new ConsulConnect object @@ -104,68 +104,88 @@ func (o *ConsulConnect) SetNative(v bool) { o.Native = &v } -// GetSidecarService returns the SidecarService field value if set, zero value otherwise. +// GetSidecarService returns the SidecarService field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulConnect) GetSidecarService() ConsulSidecarService { - if o == nil || o.SidecarService == nil { + if o == nil || o.SidecarService.Get() == nil { var ret ConsulSidecarService return ret } - return *o.SidecarService + return *o.SidecarService.Get() } // GetSidecarServiceOk returns a tuple with the SidecarService field value if set, nil otherwise // 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 *ConsulConnect) GetSidecarServiceOk() (*ConsulSidecarService, bool) { - if o == nil || o.SidecarService == nil { + if o == nil { return nil, false } - return o.SidecarService, true + return o.SidecarService.Get(), o.SidecarService.IsSet() } // HasSidecarService returns a boolean if a field has been set. func (o *ConsulConnect) HasSidecarService() bool { - if o != nil && o.SidecarService != nil { + if o != nil && o.SidecarService.IsSet() { return true } return false } -// SetSidecarService gets a reference to the given ConsulSidecarService and assigns it to the SidecarService field. +// SetSidecarService gets a reference to the given NullableConsulSidecarService and assigns it to the SidecarService field. func (o *ConsulConnect) SetSidecarService(v ConsulSidecarService) { - o.SidecarService = &v + o.SidecarService.Set(&v) +} +// SetSidecarServiceNil sets the value for SidecarService to be an explicit nil +func (o *ConsulConnect) SetSidecarServiceNil() { + o.SidecarService.Set(nil) +} + +// UnsetSidecarService ensures that no value is present for SidecarService, not even an explicit nil +func (o *ConsulConnect) UnsetSidecarService() { + o.SidecarService.Unset() } -// GetSidecarTask returns the SidecarTask field value if set, zero value otherwise. +// GetSidecarTask returns the SidecarTask field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulConnect) GetSidecarTask() SidecarTask { - if o == nil || o.SidecarTask == nil { + if o == nil || o.SidecarTask.Get() == nil { var ret SidecarTask return ret } - return *o.SidecarTask + return *o.SidecarTask.Get() } // GetSidecarTaskOk returns a tuple with the SidecarTask field value if set, nil otherwise // 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 *ConsulConnect) GetSidecarTaskOk() (*SidecarTask, bool) { - if o == nil || o.SidecarTask == nil { + if o == nil { return nil, false } - return o.SidecarTask, true + return o.SidecarTask.Get(), o.SidecarTask.IsSet() } // HasSidecarTask returns a boolean if a field has been set. func (o *ConsulConnect) HasSidecarTask() bool { - if o != nil && o.SidecarTask != nil { + if o != nil && o.SidecarTask.IsSet() { return true } return false } -// SetSidecarTask gets a reference to the given SidecarTask and assigns it to the SidecarTask field. +// SetSidecarTask gets a reference to the given NullableSidecarTask and assigns it to the SidecarTask field. func (o *ConsulConnect) SetSidecarTask(v SidecarTask) { - o.SidecarTask = &v + o.SidecarTask.Set(&v) +} +// SetSidecarTaskNil sets the value for SidecarTask to be an explicit nil +func (o *ConsulConnect) SetSidecarTaskNil() { + o.SidecarTask.Set(nil) +} + +// UnsetSidecarTask ensures that no value is present for SidecarTask, not even an explicit nil +func (o *ConsulConnect) UnsetSidecarTask() { + o.SidecarTask.Unset() } func (o ConsulConnect) MarshalJSON() ([]byte, error) { @@ -176,11 +196,11 @@ func (o ConsulConnect) MarshalJSON() ([]byte, error) { if o.Native != nil { toSerialize["Native"] = o.Native } - if o.SidecarService != nil { - toSerialize["SidecarService"] = o.SidecarService + if o.SidecarService.IsSet() { + toSerialize["SidecarService"] = o.SidecarService.Get() } - if o.SidecarTask != nil { - toSerialize["SidecarTask"] = o.SidecarTask + if o.SidecarTask.IsSet() { + toSerialize["SidecarTask"] = o.SidecarTask.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_consul_expose_config.go b/clients/go/v1/model_consul_expose_config.go index 45ad0ae7..640619ca 100644 --- a/clients/go/v1/model_consul_expose_config.go +++ b/clients/go/v1/model_consul_expose_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // ConsulExposeConfig struct for ConsulExposeConfig type ConsulExposeConfig struct { - Path *[]ConsulExposePath `json:"Path,omitempty"` + Path []ConsulExposePath `json:"Path,omitempty"` } // NewConsulExposeConfig instantiates a new ConsulExposeConfig object @@ -43,12 +43,12 @@ func (o *ConsulExposeConfig) GetPath() []ConsulExposePath { var ret []ConsulExposePath return ret } - return *o.Path + return o.Path } // GetPathOk returns a tuple with the Path field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulExposeConfig) GetPathOk() (*[]ConsulExposePath, bool) { +func (o *ConsulExposeConfig) GetPathOk() ([]ConsulExposePath, bool) { if o == nil || o.Path == nil { return nil, false } @@ -66,7 +66,7 @@ func (o *ConsulExposeConfig) HasPath() bool { // SetPath gets a reference to the given []ConsulExposePath and assigns it to the Path field. func (o *ConsulExposeConfig) SetPath(v []ConsulExposePath) { - o.Path = &v + o.Path = v } func (o ConsulExposeConfig) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_consul_expose_path.go b/clients/go/v1/model_consul_expose_path.go index 2e3b695b..ce4a7dd1 100644 --- a/clients/go/v1/model_consul_expose_path.go +++ b/clients/go/v1/model_consul_expose_path.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul_gateway.go b/clients/go/v1/model_consul_gateway.go index 2d26b887..9c3d4121 100644 --- a/clients/go/v1/model_consul_gateway.go +++ b/clients/go/v1/model_consul_gateway.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // ConsulGateway struct for ConsulGateway type ConsulGateway struct { - Ingress *ConsulIngressConfigEntry `json:"Ingress,omitempty"` + Ingress NullableConsulIngressConfigEntry `json:"Ingress,omitempty"` Mesh interface{} `json:"Mesh,omitempty"` - Proxy *ConsulGatewayProxy `json:"Proxy,omitempty"` - Terminating *ConsulTerminatingConfigEntry `json:"Terminating,omitempty"` + Proxy NullableConsulGatewayProxy `json:"Proxy,omitempty"` + Terminating NullableConsulTerminatingConfigEntry `json:"Terminating,omitempty"` } // NewConsulGateway instantiates a new ConsulGateway object @@ -40,41 +40,51 @@ func NewConsulGatewayWithDefaults() *ConsulGateway { return &this } -// GetIngress returns the Ingress field value if set, zero value otherwise. +// GetIngress returns the Ingress field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulGateway) GetIngress() ConsulIngressConfigEntry { - if o == nil || o.Ingress == nil { + if o == nil || o.Ingress.Get() == nil { var ret ConsulIngressConfigEntry return ret } - return *o.Ingress + return *o.Ingress.Get() } // GetIngressOk returns a tuple with the Ingress field value if set, nil otherwise // 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 *ConsulGateway) GetIngressOk() (*ConsulIngressConfigEntry, bool) { - if o == nil || o.Ingress == nil { + if o == nil { return nil, false } - return o.Ingress, true + return o.Ingress.Get(), o.Ingress.IsSet() } // HasIngress returns a boolean if a field has been set. func (o *ConsulGateway) HasIngress() bool { - if o != nil && o.Ingress != nil { + if o != nil && o.Ingress.IsSet() { return true } return false } -// SetIngress gets a reference to the given ConsulIngressConfigEntry and assigns it to the Ingress field. +// SetIngress gets a reference to the given NullableConsulIngressConfigEntry and assigns it to the Ingress field. func (o *ConsulGateway) SetIngress(v ConsulIngressConfigEntry) { - o.Ingress = &v + o.Ingress.Set(&v) +} +// SetIngressNil sets the value for Ingress to be an explicit nil +func (o *ConsulGateway) SetIngressNil() { + o.Ingress.Set(nil) +} + +// UnsetIngress ensures that no value is present for Ingress, not even an explicit nil +func (o *ConsulGateway) UnsetIngress() { + o.Ingress.Unset() } // GetMesh returns the Mesh field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulGateway) GetMesh() interface{} { - if o == nil { + if o == nil { var ret interface{} return ret } @@ -105,83 +115,103 @@ func (o *ConsulGateway) SetMesh(v interface{}) { o.Mesh = v } -// GetProxy returns the Proxy field value if set, zero value otherwise. +// GetProxy returns the Proxy field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulGateway) GetProxy() ConsulGatewayProxy { - if o == nil || o.Proxy == nil { + if o == nil || o.Proxy.Get() == nil { var ret ConsulGatewayProxy return ret } - return *o.Proxy + return *o.Proxy.Get() } // GetProxyOk returns a tuple with the Proxy field value if set, nil otherwise // 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 *ConsulGateway) GetProxyOk() (*ConsulGatewayProxy, bool) { - if o == nil || o.Proxy == nil { + if o == nil { return nil, false } - return o.Proxy, true + return o.Proxy.Get(), o.Proxy.IsSet() } // HasProxy returns a boolean if a field has been set. func (o *ConsulGateway) HasProxy() bool { - if o != nil && o.Proxy != nil { + if o != nil && o.Proxy.IsSet() { return true } return false } -// SetProxy gets a reference to the given ConsulGatewayProxy and assigns it to the Proxy field. +// SetProxy gets a reference to the given NullableConsulGatewayProxy and assigns it to the Proxy field. func (o *ConsulGateway) SetProxy(v ConsulGatewayProxy) { - o.Proxy = &v + o.Proxy.Set(&v) +} +// SetProxyNil sets the value for Proxy to be an explicit nil +func (o *ConsulGateway) SetProxyNil() { + o.Proxy.Set(nil) +} + +// UnsetProxy ensures that no value is present for Proxy, not even an explicit nil +func (o *ConsulGateway) UnsetProxy() { + o.Proxy.Unset() } -// GetTerminating returns the Terminating field value if set, zero value otherwise. +// GetTerminating returns the Terminating field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulGateway) GetTerminating() ConsulTerminatingConfigEntry { - if o == nil || o.Terminating == nil { + if o == nil || o.Terminating.Get() == nil { var ret ConsulTerminatingConfigEntry return ret } - return *o.Terminating + return *o.Terminating.Get() } // GetTerminatingOk returns a tuple with the Terminating field value if set, nil otherwise // 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 *ConsulGateway) GetTerminatingOk() (*ConsulTerminatingConfigEntry, bool) { - if o == nil || o.Terminating == nil { + if o == nil { return nil, false } - return o.Terminating, true + return o.Terminating.Get(), o.Terminating.IsSet() } // HasTerminating returns a boolean if a field has been set. func (o *ConsulGateway) HasTerminating() bool { - if o != nil && o.Terminating != nil { + if o != nil && o.Terminating.IsSet() { return true } return false } -// SetTerminating gets a reference to the given ConsulTerminatingConfigEntry and assigns it to the Terminating field. +// SetTerminating gets a reference to the given NullableConsulTerminatingConfigEntry and assigns it to the Terminating field. func (o *ConsulGateway) SetTerminating(v ConsulTerminatingConfigEntry) { - o.Terminating = &v + o.Terminating.Set(&v) +} +// SetTerminatingNil sets the value for Terminating to be an explicit nil +func (o *ConsulGateway) SetTerminatingNil() { + o.Terminating.Set(nil) +} + +// UnsetTerminating ensures that no value is present for Terminating, not even an explicit nil +func (o *ConsulGateway) UnsetTerminating() { + o.Terminating.Unset() } func (o ConsulGateway) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Ingress != nil { - toSerialize["Ingress"] = o.Ingress + if o.Ingress.IsSet() { + toSerialize["Ingress"] = o.Ingress.Get() } if o.Mesh != nil { toSerialize["Mesh"] = o.Mesh } - if o.Proxy != nil { - toSerialize["Proxy"] = o.Proxy + if o.Proxy.IsSet() { + toSerialize["Proxy"] = o.Proxy.Get() } - if o.Terminating != nil { - toSerialize["Terminating"] = o.Terminating + if o.Terminating.IsSet() { + toSerialize["Terminating"] = o.Terminating.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_consul_gateway_bind_address.go b/clients/go/v1/model_consul_gateway_bind_address.go index 75cd1f22..a7e899de 100644 --- a/clients/go/v1/model_consul_gateway_bind_address.go +++ b/clients/go/v1/model_consul_gateway_bind_address.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul_gateway_proxy.go b/clients/go/v1/model_consul_gateway_proxy.go index 6b52f45c..ae482d44 100644 --- a/clients/go/v1/model_consul_gateway_proxy.go +++ b/clients/go/v1/model_consul_gateway_proxy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // ConsulGatewayProxy struct for ConsulGatewayProxy type ConsulGatewayProxy struct { - Config *map[string]interface{} `json:"Config,omitempty"` + Config map[string]interface{} `json:"Config,omitempty"` ConnectTimeout *int64 `json:"ConnectTimeout,omitempty"` EnvoyDNSDiscoveryType *string `json:"EnvoyDNSDiscoveryType,omitempty"` EnvoyGatewayBindAddresses *map[string]ConsulGatewayBindAddress `json:"EnvoyGatewayBindAddresses,omitempty"` @@ -48,12 +48,12 @@ func (o *ConsulGatewayProxy) GetConfig() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Config + return o.Config } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulGatewayProxy) GetConfigOk() (*map[string]interface{}, bool) { +func (o *ConsulGatewayProxy) GetConfigOk() (map[string]interface{}, bool) { if o == nil || o.Config == nil { return nil, false } @@ -71,7 +71,7 @@ func (o *ConsulGatewayProxy) HasConfig() bool { // SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. func (o *ConsulGatewayProxy) SetConfig(v map[string]interface{}) { - o.Config = &v + o.Config = v } // GetConnectTimeout returns the ConnectTimeout field value if set, zero value otherwise. diff --git a/clients/go/v1/model_consul_gateway_tls_config.go b/clients/go/v1/model_consul_gateway_tls_config.go index 31c8e25b..867f804b 100644 --- a/clients/go/v1/model_consul_gateway_tls_config.go +++ b/clients/go/v1/model_consul_gateway_tls_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul_ingress_config_entry.go b/clients/go/v1/model_consul_ingress_config_entry.go index e3349857..0f25f3da 100644 --- a/clients/go/v1/model_consul_ingress_config_entry.go +++ b/clients/go/v1/model_consul_ingress_config_entry.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,8 +17,8 @@ import ( // ConsulIngressConfigEntry struct for ConsulIngressConfigEntry type ConsulIngressConfigEntry struct { - Listeners *[]ConsulIngressListener `json:"Listeners,omitempty"` - TLS *ConsulGatewayTLSConfig `json:"TLS,omitempty"` + Listeners []ConsulIngressListener `json:"Listeners,omitempty"` + TLS NullableConsulGatewayTLSConfig `json:"TLS,omitempty"` } // NewConsulIngressConfigEntry instantiates a new ConsulIngressConfigEntry object @@ -44,12 +44,12 @@ func (o *ConsulIngressConfigEntry) GetListeners() []ConsulIngressListener { var ret []ConsulIngressListener return ret } - return *o.Listeners + return o.Listeners } // GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulIngressConfigEntry) GetListenersOk() (*[]ConsulIngressListener, bool) { +func (o *ConsulIngressConfigEntry) GetListenersOk() ([]ConsulIngressListener, bool) { if o == nil || o.Listeners == nil { return nil, false } @@ -67,39 +67,49 @@ func (o *ConsulIngressConfigEntry) HasListeners() bool { // SetListeners gets a reference to the given []ConsulIngressListener and assigns it to the Listeners field. func (o *ConsulIngressConfigEntry) SetListeners(v []ConsulIngressListener) { - o.Listeners = &v + o.Listeners = v } -// GetTLS returns the TLS field value if set, zero value otherwise. +// GetTLS returns the TLS field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulIngressConfigEntry) GetTLS() ConsulGatewayTLSConfig { - if o == nil || o.TLS == nil { + if o == nil || o.TLS.Get() == nil { var ret ConsulGatewayTLSConfig return ret } - return *o.TLS + return *o.TLS.Get() } // GetTLSOk returns a tuple with the TLS field value if set, nil otherwise // 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 *ConsulIngressConfigEntry) GetTLSOk() (*ConsulGatewayTLSConfig, bool) { - if o == nil || o.TLS == nil { + if o == nil { return nil, false } - return o.TLS, true + return o.TLS.Get(), o.TLS.IsSet() } // HasTLS returns a boolean if a field has been set. func (o *ConsulIngressConfigEntry) HasTLS() bool { - if o != nil && o.TLS != nil { + if o != nil && o.TLS.IsSet() { return true } return false } -// SetTLS gets a reference to the given ConsulGatewayTLSConfig and assigns it to the TLS field. +// SetTLS gets a reference to the given NullableConsulGatewayTLSConfig and assigns it to the TLS field. func (o *ConsulIngressConfigEntry) SetTLS(v ConsulGatewayTLSConfig) { - o.TLS = &v + o.TLS.Set(&v) +} +// SetTLSNil sets the value for TLS to be an explicit nil +func (o *ConsulIngressConfigEntry) SetTLSNil() { + o.TLS.Set(nil) +} + +// UnsetTLS ensures that no value is present for TLS, not even an explicit nil +func (o *ConsulIngressConfigEntry) UnsetTLS() { + o.TLS.Unset() } func (o ConsulIngressConfigEntry) MarshalJSON() ([]byte, error) { @@ -107,8 +117,8 @@ func (o ConsulIngressConfigEntry) MarshalJSON() ([]byte, error) { if o.Listeners != nil { toSerialize["Listeners"] = o.Listeners } - if o.TLS != nil { - toSerialize["TLS"] = o.TLS + if o.TLS.IsSet() { + toSerialize["TLS"] = o.TLS.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_consul_ingress_listener.go b/clients/go/v1/model_consul_ingress_listener.go index 364a0c42..a1a6adff 100644 --- a/clients/go/v1/model_consul_ingress_listener.go +++ b/clients/go/v1/model_consul_ingress_listener.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type ConsulIngressListener struct { Port *int32 `json:"Port,omitempty"` Protocol *string `json:"Protocol,omitempty"` - Services *[]ConsulIngressService `json:"Services,omitempty"` + Services []ConsulIngressService `json:"Services,omitempty"` } // NewConsulIngressListener instantiates a new ConsulIngressListener object @@ -109,12 +109,12 @@ func (o *ConsulIngressListener) GetServices() []ConsulIngressService { var ret []ConsulIngressService return ret } - return *o.Services + return o.Services } // GetServicesOk returns a tuple with the Services field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulIngressListener) GetServicesOk() (*[]ConsulIngressService, bool) { +func (o *ConsulIngressListener) GetServicesOk() ([]ConsulIngressService, bool) { if o == nil || o.Services == nil { return nil, false } @@ -132,7 +132,7 @@ func (o *ConsulIngressListener) HasServices() bool { // SetServices gets a reference to the given []ConsulIngressService and assigns it to the Services field. func (o *ConsulIngressListener) SetServices(v []ConsulIngressService) { - o.Services = &v + o.Services = v } func (o ConsulIngressListener) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_consul_ingress_service.go b/clients/go/v1/model_consul_ingress_service.go index 6638aa57..8cf7689b 100644 --- a/clients/go/v1/model_consul_ingress_service.go +++ b/clients/go/v1/model_consul_ingress_service.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // ConsulIngressService struct for ConsulIngressService type ConsulIngressService struct { - Hosts *[]string `json:"Hosts,omitempty"` + Hosts []string `json:"Hosts,omitempty"` Name *string `json:"Name,omitempty"` } @@ -44,12 +44,12 @@ func (o *ConsulIngressService) GetHosts() []string { var ret []string return ret } - return *o.Hosts + return o.Hosts } // GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulIngressService) GetHostsOk() (*[]string, bool) { +func (o *ConsulIngressService) GetHostsOk() ([]string, bool) { if o == nil || o.Hosts == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *ConsulIngressService) HasHosts() bool { // SetHosts gets a reference to the given []string and assigns it to the Hosts field. func (o *ConsulIngressService) SetHosts(v []string) { - o.Hosts = &v + o.Hosts = v } // GetName returns the Name field value if set, zero value otherwise. diff --git a/clients/go/v1/model_consul_linked_service.go b/clients/go/v1/model_consul_linked_service.go index 144bcac7..59b8a6c3 100644 --- a/clients/go/v1/model_consul_linked_service.go +++ b/clients/go/v1/model_consul_linked_service.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul_mesh_gateway.go b/clients/go/v1/model_consul_mesh_gateway.go index 4c8bc15f..8d63b20e 100644 --- a/clients/go/v1/model_consul_mesh_gateway.go +++ b/clients/go/v1/model_consul_mesh_gateway.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_consul_proxy.go b/clients/go/v1/model_consul_proxy.go index 31742cf7..76e80c35 100644 --- a/clients/go/v1/model_consul_proxy.go +++ b/clients/go/v1/model_consul_proxy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,11 +17,11 @@ import ( // ConsulProxy struct for ConsulProxy type ConsulProxy struct { - Config *map[string]interface{} `json:"Config,omitempty"` - ExposeConfig *ConsulExposeConfig `json:"ExposeConfig,omitempty"` + Config map[string]interface{} `json:"Config,omitempty"` + ExposeConfig NullableConsulExposeConfig `json:"ExposeConfig,omitempty"` LocalServiceAddress *string `json:"LocalServiceAddress,omitempty"` LocalServicePort *int32 `json:"LocalServicePort,omitempty"` - Upstreams *[]ConsulUpstream `json:"Upstreams,omitempty"` + Upstreams []ConsulUpstream `json:"Upstreams,omitempty"` } // NewConsulProxy instantiates a new ConsulProxy object @@ -47,12 +47,12 @@ func (o *ConsulProxy) GetConfig() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Config + return o.Config } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulProxy) GetConfigOk() (*map[string]interface{}, bool) { +func (o *ConsulProxy) GetConfigOk() (map[string]interface{}, bool) { if o == nil || o.Config == nil { return nil, false } @@ -70,39 +70,49 @@ func (o *ConsulProxy) HasConfig() bool { // SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. func (o *ConsulProxy) SetConfig(v map[string]interface{}) { - o.Config = &v + o.Config = v } -// GetExposeConfig returns the ExposeConfig field value if set, zero value otherwise. +// GetExposeConfig returns the ExposeConfig field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulProxy) GetExposeConfig() ConsulExposeConfig { - if o == nil || o.ExposeConfig == nil { + if o == nil || o.ExposeConfig.Get() == nil { var ret ConsulExposeConfig return ret } - return *o.ExposeConfig + return *o.ExposeConfig.Get() } // GetExposeConfigOk returns a tuple with the ExposeConfig field value if set, nil otherwise // 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 *ConsulProxy) GetExposeConfigOk() (*ConsulExposeConfig, bool) { - if o == nil || o.ExposeConfig == nil { + if o == nil { return nil, false } - return o.ExposeConfig, true + return o.ExposeConfig.Get(), o.ExposeConfig.IsSet() } // HasExposeConfig returns a boolean if a field has been set. func (o *ConsulProxy) HasExposeConfig() bool { - if o != nil && o.ExposeConfig != nil { + if o != nil && o.ExposeConfig.IsSet() { return true } return false } -// SetExposeConfig gets a reference to the given ConsulExposeConfig and assigns it to the ExposeConfig field. +// SetExposeConfig gets a reference to the given NullableConsulExposeConfig and assigns it to the ExposeConfig field. func (o *ConsulProxy) SetExposeConfig(v ConsulExposeConfig) { - o.ExposeConfig = &v + o.ExposeConfig.Set(&v) +} +// SetExposeConfigNil sets the value for ExposeConfig to be an explicit nil +func (o *ConsulProxy) SetExposeConfigNil() { + o.ExposeConfig.Set(nil) +} + +// UnsetExposeConfig ensures that no value is present for ExposeConfig, not even an explicit nil +func (o *ConsulProxy) UnsetExposeConfig() { + o.ExposeConfig.Unset() } // GetLocalServiceAddress returns the LocalServiceAddress field value if set, zero value otherwise. @@ -175,12 +185,12 @@ func (o *ConsulProxy) GetUpstreams() []ConsulUpstream { var ret []ConsulUpstream return ret } - return *o.Upstreams + return o.Upstreams } // GetUpstreamsOk returns a tuple with the Upstreams field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulProxy) GetUpstreamsOk() (*[]ConsulUpstream, bool) { +func (o *ConsulProxy) GetUpstreamsOk() ([]ConsulUpstream, bool) { if o == nil || o.Upstreams == nil { return nil, false } @@ -198,7 +208,7 @@ func (o *ConsulProxy) HasUpstreams() bool { // SetUpstreams gets a reference to the given []ConsulUpstream and assigns it to the Upstreams field. func (o *ConsulProxy) SetUpstreams(v []ConsulUpstream) { - o.Upstreams = &v + o.Upstreams = v } func (o ConsulProxy) MarshalJSON() ([]byte, error) { @@ -206,8 +216,8 @@ func (o ConsulProxy) MarshalJSON() ([]byte, error) { if o.Config != nil { toSerialize["Config"] = o.Config } - if o.ExposeConfig != nil { - toSerialize["ExposeConfig"] = o.ExposeConfig + if o.ExposeConfig.IsSet() { + toSerialize["ExposeConfig"] = o.ExposeConfig.Get() } if o.LocalServiceAddress != nil { toSerialize["LocalServiceAddress"] = o.LocalServiceAddress diff --git a/clients/go/v1/model_consul_sidecar_service.go b/clients/go/v1/model_consul_sidecar_service.go index aed46f56..1327f669 100644 --- a/clients/go/v1/model_consul_sidecar_service.go +++ b/clients/go/v1/model_consul_sidecar_service.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ import ( type ConsulSidecarService struct { DisableDefaultTCPCheck *bool `json:"DisableDefaultTCPCheck,omitempty"` Port *string `json:"Port,omitempty"` - Proxy *ConsulProxy `json:"Proxy,omitempty"` - Tags *[]string `json:"Tags,omitempty"` + Proxy NullableConsulProxy `json:"Proxy,omitempty"` + Tags []string `json:"Tags,omitempty"` } // NewConsulSidecarService instantiates a new ConsulSidecarService object @@ -104,36 +104,46 @@ func (o *ConsulSidecarService) SetPort(v string) { o.Port = &v } -// GetProxy returns the Proxy field value if set, zero value otherwise. +// GetProxy returns the Proxy field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulSidecarService) GetProxy() ConsulProxy { - if o == nil || o.Proxy == nil { + if o == nil || o.Proxy.Get() == nil { var ret ConsulProxy return ret } - return *o.Proxy + return *o.Proxy.Get() } // GetProxyOk returns a tuple with the Proxy field value if set, nil otherwise // 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 *ConsulSidecarService) GetProxyOk() (*ConsulProxy, bool) { - if o == nil || o.Proxy == nil { + if o == nil { return nil, false } - return o.Proxy, true + return o.Proxy.Get(), o.Proxy.IsSet() } // HasProxy returns a boolean if a field has been set. func (o *ConsulSidecarService) HasProxy() bool { - if o != nil && o.Proxy != nil { + if o != nil && o.Proxy.IsSet() { return true } return false } -// SetProxy gets a reference to the given ConsulProxy and assigns it to the Proxy field. +// SetProxy gets a reference to the given NullableConsulProxy and assigns it to the Proxy field. func (o *ConsulSidecarService) SetProxy(v ConsulProxy) { - o.Proxy = &v + o.Proxy.Set(&v) +} +// SetProxyNil sets the value for Proxy to be an explicit nil +func (o *ConsulSidecarService) SetProxyNil() { + o.Proxy.Set(nil) +} + +// UnsetProxy ensures that no value is present for Proxy, not even an explicit nil +func (o *ConsulSidecarService) UnsetProxy() { + o.Proxy.Unset() } // GetTags returns the Tags field value if set, zero value otherwise. @@ -142,12 +152,12 @@ func (o *ConsulSidecarService) GetTags() []string { var ret []string return ret } - return *o.Tags + return o.Tags } // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulSidecarService) GetTagsOk() (*[]string, bool) { +func (o *ConsulSidecarService) GetTagsOk() ([]string, bool) { if o == nil || o.Tags == nil { return nil, false } @@ -165,7 +175,7 @@ func (o *ConsulSidecarService) HasTags() bool { // SetTags gets a reference to the given []string and assigns it to the Tags field. func (o *ConsulSidecarService) SetTags(v []string) { - o.Tags = &v + o.Tags = v } func (o ConsulSidecarService) MarshalJSON() ([]byte, error) { @@ -176,8 +186,8 @@ func (o ConsulSidecarService) MarshalJSON() ([]byte, error) { if o.Port != nil { toSerialize["Port"] = o.Port } - if o.Proxy != nil { - toSerialize["Proxy"] = o.Proxy + if o.Proxy.IsSet() { + toSerialize["Proxy"] = o.Proxy.Get() } if o.Tags != nil { toSerialize["Tags"] = o.Tags diff --git a/clients/go/v1/model_consul_terminating_config_entry.go b/clients/go/v1/model_consul_terminating_config_entry.go index c804afd3..a6e5ea99 100644 --- a/clients/go/v1/model_consul_terminating_config_entry.go +++ b/clients/go/v1/model_consul_terminating_config_entry.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // ConsulTerminatingConfigEntry struct for ConsulTerminatingConfigEntry type ConsulTerminatingConfigEntry struct { - Services *[]ConsulLinkedService `json:"Services,omitempty"` + Services []ConsulLinkedService `json:"Services,omitempty"` } // NewConsulTerminatingConfigEntry instantiates a new ConsulTerminatingConfigEntry object @@ -43,12 +43,12 @@ func (o *ConsulTerminatingConfigEntry) GetServices() []ConsulLinkedService { var ret []ConsulLinkedService return ret } - return *o.Services + return o.Services } // GetServicesOk returns a tuple with the Services field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsulTerminatingConfigEntry) GetServicesOk() (*[]ConsulLinkedService, bool) { +func (o *ConsulTerminatingConfigEntry) GetServicesOk() ([]ConsulLinkedService, bool) { if o == nil || o.Services == nil { return nil, false } @@ -66,7 +66,7 @@ func (o *ConsulTerminatingConfigEntry) HasServices() bool { // SetServices gets a reference to the given []ConsulLinkedService and assigns it to the Services field. func (o *ConsulTerminatingConfigEntry) SetServices(v []ConsulLinkedService) { - o.Services = &v + o.Services = v } func (o ConsulTerminatingConfigEntry) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_consul_upstream.go b/clients/go/v1/model_consul_upstream.go index 344e3224..c3e8ee2c 100644 --- a/clients/go/v1/model_consul_upstream.go +++ b/clients/go/v1/model_consul_upstream.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type ConsulUpstream struct { DestinationNamespace *string `json:"DestinationNamespace,omitempty"` LocalBindAddress *string `json:"LocalBindAddress,omitempty"` LocalBindPort *int32 `json:"LocalBindPort,omitempty"` - MeshGateway *ConsulMeshGateway `json:"MeshGateway,omitempty"` + MeshGateway NullableConsulMeshGateway `json:"MeshGateway,omitempty"` } // NewConsulUpstream instantiates a new ConsulUpstream object @@ -202,36 +202,46 @@ func (o *ConsulUpstream) SetLocalBindPort(v int32) { o.LocalBindPort = &v } -// GetMeshGateway returns the MeshGateway field value if set, zero value otherwise. +// GetMeshGateway returns the MeshGateway field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsulUpstream) GetMeshGateway() ConsulMeshGateway { - if o == nil || o.MeshGateway == nil { + if o == nil || o.MeshGateway.Get() == nil { var ret ConsulMeshGateway return ret } - return *o.MeshGateway + return *o.MeshGateway.Get() } // GetMeshGatewayOk returns a tuple with the MeshGateway field value if set, nil otherwise // 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 *ConsulUpstream) GetMeshGatewayOk() (*ConsulMeshGateway, bool) { - if o == nil || o.MeshGateway == nil { + if o == nil { return nil, false } - return o.MeshGateway, true + return o.MeshGateway.Get(), o.MeshGateway.IsSet() } // HasMeshGateway returns a boolean if a field has been set. func (o *ConsulUpstream) HasMeshGateway() bool { - if o != nil && o.MeshGateway != nil { + if o != nil && o.MeshGateway.IsSet() { return true } return false } -// SetMeshGateway gets a reference to the given ConsulMeshGateway and assigns it to the MeshGateway field. +// SetMeshGateway gets a reference to the given NullableConsulMeshGateway and assigns it to the MeshGateway field. func (o *ConsulUpstream) SetMeshGateway(v ConsulMeshGateway) { - o.MeshGateway = &v + o.MeshGateway.Set(&v) +} +// SetMeshGatewayNil sets the value for MeshGateway to be an explicit nil +func (o *ConsulUpstream) SetMeshGatewayNil() { + o.MeshGateway.Set(nil) +} + +// UnsetMeshGateway ensures that no value is present for MeshGateway, not even an explicit nil +func (o *ConsulUpstream) UnsetMeshGateway() { + o.MeshGateway.Unset() } func (o ConsulUpstream) MarshalJSON() ([]byte, error) { @@ -251,8 +261,8 @@ func (o ConsulUpstream) MarshalJSON() ([]byte, error) { if o.LocalBindPort != nil { toSerialize["LocalBindPort"] = o.LocalBindPort } - if o.MeshGateway != nil { - toSerialize["MeshGateway"] = o.MeshGateway + if o.MeshGateway.IsSet() { + toSerialize["MeshGateway"] = o.MeshGateway.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_csi_controller_info.go b/clients/go/v1/model_csi_controller_info.go index a44dc9b0..6dd3238c 100644 --- a/clients/go/v1/model_csi_controller_info.go +++ b/clients/go/v1/model_csi_controller_info.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_csi_info.go b/clients/go/v1/model_csi_info.go index 6847c9f9..df2a1287 100644 --- a/clients/go/v1/model_csi_info.go +++ b/clients/go/v1/model_csi_info.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,14 +19,14 @@ import ( // CSIInfo struct for CSIInfo type CSIInfo struct { AllocID *string `json:"AllocID,omitempty"` - ControllerInfo *CSIControllerInfo `json:"ControllerInfo,omitempty"` + ControllerInfo NullableCSIControllerInfo `json:"ControllerInfo,omitempty"` HealthDescription *string `json:"HealthDescription,omitempty"` Healthy *bool `json:"Healthy,omitempty"` - NodeInfo *CSINodeInfo `json:"NodeInfo,omitempty"` + NodeInfo NullableCSINodeInfo `json:"NodeInfo,omitempty"` PluginID *string `json:"PluginID,omitempty"` RequiresControllerPlugin *bool `json:"RequiresControllerPlugin,omitempty"` RequiresTopologies *bool `json:"RequiresTopologies,omitempty"` - UpdateTime *time.Time `json:"UpdateTime,omitempty"` + UpdateTime NullableTime `json:"UpdateTime,omitempty"` } // NewCSIInfo instantiates a new CSIInfo object @@ -78,36 +78,46 @@ func (o *CSIInfo) SetAllocID(v string) { o.AllocID = &v } -// GetControllerInfo returns the ControllerInfo field value if set, zero value otherwise. +// GetControllerInfo returns the ControllerInfo field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIInfo) GetControllerInfo() CSIControllerInfo { - if o == nil || o.ControllerInfo == nil { + if o == nil || o.ControllerInfo.Get() == nil { var ret CSIControllerInfo return ret } - return *o.ControllerInfo + return *o.ControllerInfo.Get() } // GetControllerInfoOk returns a tuple with the ControllerInfo field value if set, nil otherwise // 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 *CSIInfo) GetControllerInfoOk() (*CSIControllerInfo, bool) { - if o == nil || o.ControllerInfo == nil { + if o == nil { return nil, false } - return o.ControllerInfo, true + return o.ControllerInfo.Get(), o.ControllerInfo.IsSet() } // HasControllerInfo returns a boolean if a field has been set. func (o *CSIInfo) HasControllerInfo() bool { - if o != nil && o.ControllerInfo != nil { + if o != nil && o.ControllerInfo.IsSet() { return true } return false } -// SetControllerInfo gets a reference to the given CSIControllerInfo and assigns it to the ControllerInfo field. +// SetControllerInfo gets a reference to the given NullableCSIControllerInfo and assigns it to the ControllerInfo field. func (o *CSIInfo) SetControllerInfo(v CSIControllerInfo) { - o.ControllerInfo = &v + o.ControllerInfo.Set(&v) +} +// SetControllerInfoNil sets the value for ControllerInfo to be an explicit nil +func (o *CSIInfo) SetControllerInfoNil() { + o.ControllerInfo.Set(nil) +} + +// UnsetControllerInfo ensures that no value is present for ControllerInfo, not even an explicit nil +func (o *CSIInfo) UnsetControllerInfo() { + o.ControllerInfo.Unset() } // GetHealthDescription returns the HealthDescription field value if set, zero value otherwise. @@ -174,36 +184,46 @@ func (o *CSIInfo) SetHealthy(v bool) { o.Healthy = &v } -// GetNodeInfo returns the NodeInfo field value if set, zero value otherwise. +// GetNodeInfo returns the NodeInfo field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIInfo) GetNodeInfo() CSINodeInfo { - if o == nil || o.NodeInfo == nil { + if o == nil || o.NodeInfo.Get() == nil { var ret CSINodeInfo return ret } - return *o.NodeInfo + return *o.NodeInfo.Get() } // GetNodeInfoOk returns a tuple with the NodeInfo field value if set, nil otherwise // 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 *CSIInfo) GetNodeInfoOk() (*CSINodeInfo, bool) { - if o == nil || o.NodeInfo == nil { + if o == nil { return nil, false } - return o.NodeInfo, true + return o.NodeInfo.Get(), o.NodeInfo.IsSet() } // HasNodeInfo returns a boolean if a field has been set. func (o *CSIInfo) HasNodeInfo() bool { - if o != nil && o.NodeInfo != nil { + if o != nil && o.NodeInfo.IsSet() { return true } return false } -// SetNodeInfo gets a reference to the given CSINodeInfo and assigns it to the NodeInfo field. +// SetNodeInfo gets a reference to the given NullableCSINodeInfo and assigns it to the NodeInfo field. func (o *CSIInfo) SetNodeInfo(v CSINodeInfo) { - o.NodeInfo = &v + o.NodeInfo.Set(&v) +} +// SetNodeInfoNil sets the value for NodeInfo to be an explicit nil +func (o *CSIInfo) SetNodeInfoNil() { + o.NodeInfo.Set(nil) +} + +// UnsetNodeInfo ensures that no value is present for NodeInfo, not even an explicit nil +func (o *CSIInfo) UnsetNodeInfo() { + o.NodeInfo.Unset() } // GetPluginID returns the PluginID field value if set, zero value otherwise. @@ -302,36 +322,46 @@ func (o *CSIInfo) SetRequiresTopologies(v bool) { o.RequiresTopologies = &v } -// GetUpdateTime returns the UpdateTime field value if set, zero value otherwise. +// GetUpdateTime returns the UpdateTime field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIInfo) GetUpdateTime() time.Time { - if o == nil || o.UpdateTime == nil { + if o == nil || o.UpdateTime.Get() == nil { var ret time.Time return ret } - return *o.UpdateTime + return *o.UpdateTime.Get() } // GetUpdateTimeOk returns a tuple with the UpdateTime field value if set, nil otherwise // 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 *CSIInfo) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil || o.UpdateTime == nil { + if o == nil { return nil, false } - return o.UpdateTime, true + return o.UpdateTime.Get(), o.UpdateTime.IsSet() } // HasUpdateTime returns a boolean if a field has been set. func (o *CSIInfo) HasUpdateTime() bool { - if o != nil && o.UpdateTime != nil { + if o != nil && o.UpdateTime.IsSet() { return true } return false } -// SetUpdateTime gets a reference to the given time.Time and assigns it to the UpdateTime field. +// SetUpdateTime gets a reference to the given NullableTime and assigns it to the UpdateTime field. func (o *CSIInfo) SetUpdateTime(v time.Time) { - o.UpdateTime = &v + o.UpdateTime.Set(&v) +} +// SetUpdateTimeNil sets the value for UpdateTime to be an explicit nil +func (o *CSIInfo) SetUpdateTimeNil() { + o.UpdateTime.Set(nil) +} + +// UnsetUpdateTime ensures that no value is present for UpdateTime, not even an explicit nil +func (o *CSIInfo) UnsetUpdateTime() { + o.UpdateTime.Unset() } func (o CSIInfo) MarshalJSON() ([]byte, error) { @@ -339,8 +369,8 @@ func (o CSIInfo) MarshalJSON() ([]byte, error) { if o.AllocID != nil { toSerialize["AllocID"] = o.AllocID } - if o.ControllerInfo != nil { - toSerialize["ControllerInfo"] = o.ControllerInfo + if o.ControllerInfo.IsSet() { + toSerialize["ControllerInfo"] = o.ControllerInfo.Get() } if o.HealthDescription != nil { toSerialize["HealthDescription"] = o.HealthDescription @@ -348,8 +378,8 @@ func (o CSIInfo) MarshalJSON() ([]byte, error) { if o.Healthy != nil { toSerialize["Healthy"] = o.Healthy } - if o.NodeInfo != nil { - toSerialize["NodeInfo"] = o.NodeInfo + if o.NodeInfo.IsSet() { + toSerialize["NodeInfo"] = o.NodeInfo.Get() } if o.PluginID != nil { toSerialize["PluginID"] = o.PluginID @@ -360,8 +390,8 @@ func (o CSIInfo) MarshalJSON() ([]byte, error) { if o.RequiresTopologies != nil { toSerialize["RequiresTopologies"] = o.RequiresTopologies } - if o.UpdateTime != nil { - toSerialize["UpdateTime"] = o.UpdateTime + if o.UpdateTime.IsSet() { + toSerialize["UpdateTime"] = o.UpdateTime.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_csi_mount_options.go b/clients/go/v1/model_csi_mount_options.go index cae6aa7d..603dd465 100644 --- a/clients/go/v1/model_csi_mount_options.go +++ b/clients/go/v1/model_csi_mount_options.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // CSIMountOptions struct for CSIMountOptions type CSIMountOptions struct { FSType *string `json:"FSType,omitempty"` - MountFlags *[]string `json:"MountFlags,omitempty"` + MountFlags []string `json:"MountFlags,omitempty"` } // NewCSIMountOptions instantiates a new CSIMountOptions object @@ -76,12 +76,12 @@ func (o *CSIMountOptions) GetMountFlags() []string { var ret []string return ret } - return *o.MountFlags + return o.MountFlags } // GetMountFlagsOk returns a tuple with the MountFlags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIMountOptions) GetMountFlagsOk() (*[]string, bool) { +func (o *CSIMountOptions) GetMountFlagsOk() ([]string, bool) { if o == nil || o.MountFlags == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *CSIMountOptions) HasMountFlags() bool { // SetMountFlags gets a reference to the given []string and assigns it to the MountFlags field. func (o *CSIMountOptions) SetMountFlags(v []string) { - o.MountFlags = &v + o.MountFlags = v } func (o CSIMountOptions) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_node_info.go b/clients/go/v1/model_csi_node_info.go index 37ae31d9..a6632bbe 100644 --- a/clients/go/v1/model_csi_node_info.go +++ b/clients/go/v1/model_csi_node_info.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // CSINodeInfo struct for CSINodeInfo type CSINodeInfo struct { - AccessibleTopology *CSITopology `json:"AccessibleTopology,omitempty"` + AccessibleTopology NullableCSITopology `json:"AccessibleTopology,omitempty"` ID *string `json:"ID,omitempty"` MaxVolumes *int64 `json:"MaxVolumes,omitempty"` RequiresNodeStageVolume *bool `json:"RequiresNodeStageVolume,omitempty"` @@ -43,36 +43,46 @@ func NewCSINodeInfoWithDefaults() *CSINodeInfo { return &this } -// GetAccessibleTopology returns the AccessibleTopology field value if set, zero value otherwise. +// GetAccessibleTopology returns the AccessibleTopology field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSINodeInfo) GetAccessibleTopology() CSITopology { - if o == nil || o.AccessibleTopology == nil { + if o == nil || o.AccessibleTopology.Get() == nil { var ret CSITopology return ret } - return *o.AccessibleTopology + return *o.AccessibleTopology.Get() } // GetAccessibleTopologyOk returns a tuple with the AccessibleTopology field value if set, nil otherwise // 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 *CSINodeInfo) GetAccessibleTopologyOk() (*CSITopology, bool) { - if o == nil || o.AccessibleTopology == nil { + if o == nil { return nil, false } - return o.AccessibleTopology, true + return o.AccessibleTopology.Get(), o.AccessibleTopology.IsSet() } // HasAccessibleTopology returns a boolean if a field has been set. func (o *CSINodeInfo) HasAccessibleTopology() bool { - if o != nil && o.AccessibleTopology != nil { + if o != nil && o.AccessibleTopology.IsSet() { return true } return false } -// SetAccessibleTopology gets a reference to the given CSITopology and assigns it to the AccessibleTopology field. +// SetAccessibleTopology gets a reference to the given NullableCSITopology and assigns it to the AccessibleTopology field. func (o *CSINodeInfo) SetAccessibleTopology(v CSITopology) { - o.AccessibleTopology = &v + o.AccessibleTopology.Set(&v) +} +// SetAccessibleTopologyNil sets the value for AccessibleTopology to be an explicit nil +func (o *CSINodeInfo) SetAccessibleTopologyNil() { + o.AccessibleTopology.Set(nil) +} + +// UnsetAccessibleTopology ensures that no value is present for AccessibleTopology, not even an explicit nil +func (o *CSINodeInfo) UnsetAccessibleTopology() { + o.AccessibleTopology.Unset() } // GetID returns the ID field value if set, zero value otherwise. @@ -269,8 +279,8 @@ func (o *CSINodeInfo) SetSupportsStats(v bool) { func (o CSINodeInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AccessibleTopology != nil { - toSerialize["AccessibleTopology"] = o.AccessibleTopology + if o.AccessibleTopology.IsSet() { + toSerialize["AccessibleTopology"] = o.AccessibleTopology.Get() } if o.ID != nil { toSerialize["ID"] = o.ID diff --git a/clients/go/v1/model_csi_plugin.go b/clients/go/v1/model_csi_plugin.go index 2561a544..d976678a 100644 --- a/clients/go/v1/model_csi_plugin.go +++ b/clients/go/v1/model_csi_plugin.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // CSIPlugin struct for CSIPlugin type CSIPlugin struct { - Allocations *[]AllocationListStub `json:"Allocations,omitempty"` + Allocations []AllocationListStub `json:"Allocations,omitempty"` ControllerRequired *bool `json:"ControllerRequired,omitempty"` Controllers *map[string]CSIInfo `json:"Controllers,omitempty"` ControllersExpected *int32 `json:"ControllersExpected,omitempty"` @@ -55,12 +55,12 @@ func (o *CSIPlugin) GetAllocations() []AllocationListStub { var ret []AllocationListStub return ret } - return *o.Allocations + return o.Allocations } // GetAllocationsOk returns a tuple with the Allocations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIPlugin) GetAllocationsOk() (*[]AllocationListStub, bool) { +func (o *CSIPlugin) GetAllocationsOk() ([]AllocationListStub, bool) { if o == nil || o.Allocations == nil { return nil, false } @@ -78,7 +78,7 @@ func (o *CSIPlugin) HasAllocations() bool { // SetAllocations gets a reference to the given []AllocationListStub and assigns it to the Allocations field. func (o *CSIPlugin) SetAllocations(v []AllocationListStub) { - o.Allocations = &v + o.Allocations = v } // GetControllerRequired returns the ControllerRequired field value if set, zero value otherwise. diff --git a/clients/go/v1/model_csi_plugin_list_stub.go b/clients/go/v1/model_csi_plugin_list_stub.go index 92a47ae6..2c34f252 100644 --- a/clients/go/v1/model_csi_plugin_list_stub.go +++ b/clients/go/v1/model_csi_plugin_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_csi_snapshot.go b/clients/go/v1/model_csi_snapshot.go index 3323a7e9..18900b35 100644 --- a/clients/go/v1/model_csi_snapshot.go +++ b/clients/go/v1/model_csi_snapshot.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_csi_snapshot_create_request.go b/clients/go/v1/model_csi_snapshot_create_request.go index f043d6ad..191eecc0 100644 --- a/clients/go/v1/model_csi_snapshot_create_request.go +++ b/clients/go/v1/model_csi_snapshot_create_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ type CSISnapshotCreateRequest struct { Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` SecretID *string `json:"SecretID,omitempty"` - Snapshots *[]CSISnapshot `json:"Snapshots,omitempty"` + Snapshots []CSISnapshot `json:"Snapshots,omitempty"` } // NewCSISnapshotCreateRequest instantiates a new CSISnapshotCreateRequest object @@ -142,12 +142,12 @@ func (o *CSISnapshotCreateRequest) GetSnapshots() []CSISnapshot { var ret []CSISnapshot return ret } - return *o.Snapshots + return o.Snapshots } // GetSnapshotsOk returns a tuple with the Snapshots field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSISnapshotCreateRequest) GetSnapshotsOk() (*[]CSISnapshot, bool) { +func (o *CSISnapshotCreateRequest) GetSnapshotsOk() ([]CSISnapshot, bool) { if o == nil || o.Snapshots == nil { return nil, false } @@ -165,7 +165,7 @@ func (o *CSISnapshotCreateRequest) HasSnapshots() bool { // SetSnapshots gets a reference to the given []CSISnapshot and assigns it to the Snapshots field. func (o *CSISnapshotCreateRequest) SetSnapshots(v []CSISnapshot) { - o.Snapshots = &v + o.Snapshots = v } func (o CSISnapshotCreateRequest) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_snapshot_create_response.go b/clients/go/v1/model_csi_snapshot_create_response.go index 07181b52..4d5bfb97 100644 --- a/clients/go/v1/model_csi_snapshot_create_response.go +++ b/clients/go/v1/model_csi_snapshot_create_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type CSISnapshotCreateResponse struct { LastIndex *int32 `json:"LastIndex,omitempty"` NextToken *string `json:"NextToken,omitempty"` RequestTime *int64 `json:"RequestTime,omitempty"` - Snapshots *[]CSISnapshot `json:"Snapshots,omitempty"` + Snapshots []CSISnapshot `json:"Snapshots,omitempty"` } // NewCSISnapshotCreateResponse instantiates a new CSISnapshotCreateResponse object @@ -208,12 +208,12 @@ func (o *CSISnapshotCreateResponse) GetSnapshots() []CSISnapshot { var ret []CSISnapshot return ret } - return *o.Snapshots + return o.Snapshots } // GetSnapshotsOk returns a tuple with the Snapshots field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSISnapshotCreateResponse) GetSnapshotsOk() (*[]CSISnapshot, bool) { +func (o *CSISnapshotCreateResponse) GetSnapshotsOk() ([]CSISnapshot, bool) { if o == nil || o.Snapshots == nil { return nil, false } @@ -231,7 +231,7 @@ func (o *CSISnapshotCreateResponse) HasSnapshots() bool { // SetSnapshots gets a reference to the given []CSISnapshot and assigns it to the Snapshots field. func (o *CSISnapshotCreateResponse) SetSnapshots(v []CSISnapshot) { - o.Snapshots = &v + o.Snapshots = v } func (o CSISnapshotCreateResponse) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_snapshot_list_response.go b/clients/go/v1/model_csi_snapshot_list_response.go index 40db53f0..0b4e5576 100644 --- a/clients/go/v1/model_csi_snapshot_list_response.go +++ b/clients/go/v1/model_csi_snapshot_list_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type CSISnapshotListResponse struct { LastIndex *int32 `json:"LastIndex,omitempty"` NextToken *string `json:"NextToken,omitempty"` RequestTime *int64 `json:"RequestTime,omitempty"` - Snapshots *[]CSISnapshot `json:"Snapshots,omitempty"` + Snapshots []CSISnapshot `json:"Snapshots,omitempty"` } // NewCSISnapshotListResponse instantiates a new CSISnapshotListResponse object @@ -208,12 +208,12 @@ func (o *CSISnapshotListResponse) GetSnapshots() []CSISnapshot { var ret []CSISnapshot return ret } - return *o.Snapshots + return o.Snapshots } // GetSnapshotsOk returns a tuple with the Snapshots field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSISnapshotListResponse) GetSnapshotsOk() (*[]CSISnapshot, bool) { +func (o *CSISnapshotListResponse) GetSnapshotsOk() ([]CSISnapshot, bool) { if o == nil || o.Snapshots == nil { return nil, false } @@ -231,7 +231,7 @@ func (o *CSISnapshotListResponse) HasSnapshots() bool { // SetSnapshots gets a reference to the given []CSISnapshot and assigns it to the Snapshots field. func (o *CSISnapshotListResponse) SetSnapshots(v []CSISnapshot) { - o.Snapshots = &v + o.Snapshots = v } func (o CSISnapshotListResponse) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_topology.go b/clients/go/v1/model_csi_topology.go index 4f9c594c..4d486671 100644 --- a/clients/go/v1/model_csi_topology.go +++ b/clients/go/v1/model_csi_topology.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_csi_topology_request.go b/clients/go/v1/model_csi_topology_request.go index 22ad58e8..1ff5712b 100644 --- a/clients/go/v1/model_csi_topology_request.go +++ b/clients/go/v1/model_csi_topology_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,8 +17,8 @@ import ( // CSITopologyRequest struct for CSITopologyRequest type CSITopologyRequest struct { - Preferred *[]CSITopology `json:"Preferred,omitempty"` - Required *[]CSITopology `json:"Required,omitempty"` + Preferred []CSITopology `json:"Preferred,omitempty"` + Required []CSITopology `json:"Required,omitempty"` } // NewCSITopologyRequest instantiates a new CSITopologyRequest object @@ -44,12 +44,12 @@ func (o *CSITopologyRequest) GetPreferred() []CSITopology { var ret []CSITopology return ret } - return *o.Preferred + return o.Preferred } // GetPreferredOk returns a tuple with the Preferred field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSITopologyRequest) GetPreferredOk() (*[]CSITopology, bool) { +func (o *CSITopologyRequest) GetPreferredOk() ([]CSITopology, bool) { if o == nil || o.Preferred == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *CSITopologyRequest) HasPreferred() bool { // SetPreferred gets a reference to the given []CSITopology and assigns it to the Preferred field. func (o *CSITopologyRequest) SetPreferred(v []CSITopology) { - o.Preferred = &v + o.Preferred = v } // GetRequired returns the Required field value if set, zero value otherwise. @@ -76,12 +76,12 @@ func (o *CSITopologyRequest) GetRequired() []CSITopology { var ret []CSITopology return ret } - return *o.Required + return o.Required } // GetRequiredOk returns a tuple with the Required field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSITopologyRequest) GetRequiredOk() (*[]CSITopology, bool) { +func (o *CSITopologyRequest) GetRequiredOk() ([]CSITopology, bool) { if o == nil || o.Required == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *CSITopologyRequest) HasRequired() bool { // SetRequired gets a reference to the given []CSITopology and assigns it to the Required field. func (o *CSITopologyRequest) SetRequired(v []CSITopology) { - o.Required = &v + o.Required = v } func (o CSITopologyRequest) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_volume.go b/clients/go/v1/model_csi_volume.go index f369adf6..44c826e2 100644 --- a/clients/go/v1/model_csi_volume.go +++ b/clients/go/v1/model_csi_volume.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( // CSIVolume struct for CSIVolume type CSIVolume struct { AccessMode *string `json:"AccessMode,omitempty"` - Allocations *[]AllocationListStub `json:"Allocations,omitempty"` + Allocations []AllocationListStub `json:"Allocations,omitempty"` AttachmentMode *string `json:"AttachmentMode,omitempty"` Capacity *int64 `json:"Capacity,omitempty"` CloneID *string `json:"CloneID,omitempty"` @@ -31,7 +31,7 @@ type CSIVolume struct { ExternalID *string `json:"ExternalID,omitempty"` ID *string `json:"ID,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` - MountOptions *CSIMountOptions `json:"MountOptions,omitempty"` + MountOptions NullableCSIMountOptions `json:"MountOptions,omitempty"` Name *string `json:"Name,omitempty"` Namespace *string `json:"Namespace,omitempty"` NodesExpected *int32 `json:"NodesExpected,omitempty"` @@ -41,15 +41,15 @@ type CSIVolume struct { Provider *string `json:"Provider,omitempty"` ProviderVersion *string `json:"ProviderVersion,omitempty"` ReadAllocs *map[string]Allocation `json:"ReadAllocs,omitempty"` - RequestedCapabilities *[]CSIVolumeCapability `json:"RequestedCapabilities,omitempty"` + RequestedCapabilities []CSIVolumeCapability `json:"RequestedCapabilities,omitempty"` RequestedCapacityMax *int64 `json:"RequestedCapacityMax,omitempty"` RequestedCapacityMin *int64 `json:"RequestedCapacityMin,omitempty"` - RequestedTopologies *CSITopologyRequest `json:"RequestedTopologies,omitempty"` - ResourceExhausted *time.Time `json:"ResourceExhausted,omitempty"` + RequestedTopologies NullableCSITopologyRequest `json:"RequestedTopologies,omitempty"` + ResourceExhausted NullableTime `json:"ResourceExhausted,omitempty"` Schedulable *bool `json:"Schedulable,omitempty"` Secrets *map[string]string `json:"Secrets,omitempty"` SnapshotID *string `json:"SnapshotID,omitempty"` - Topologies *[]CSITopology `json:"Topologies,omitempty"` + Topologies []CSITopology `json:"Topologies,omitempty"` WriteAllocs *map[string]Allocation `json:"WriteAllocs,omitempty"` } @@ -108,12 +108,12 @@ func (o *CSIVolume) GetAllocations() []AllocationListStub { var ret []AllocationListStub return ret } - return *o.Allocations + return o.Allocations } // GetAllocationsOk returns a tuple with the Allocations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolume) GetAllocationsOk() (*[]AllocationListStub, bool) { +func (o *CSIVolume) GetAllocationsOk() ([]AllocationListStub, bool) { if o == nil || o.Allocations == nil { return nil, false } @@ -131,7 +131,7 @@ func (o *CSIVolume) HasAllocations() bool { // SetAllocations gets a reference to the given []AllocationListStub and assigns it to the Allocations field. func (o *CSIVolume) SetAllocations(v []AllocationListStub) { - o.Allocations = &v + o.Allocations = v } // GetAttachmentMode returns the AttachmentMode field value if set, zero value otherwise. @@ -486,36 +486,46 @@ func (o *CSIVolume) SetModifyIndex(v int32) { o.ModifyIndex = &v } -// GetMountOptions returns the MountOptions field value if set, zero value otherwise. +// GetMountOptions returns the MountOptions field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIVolume) GetMountOptions() CSIMountOptions { - if o == nil || o.MountOptions == nil { + if o == nil || o.MountOptions.Get() == nil { var ret CSIMountOptions return ret } - return *o.MountOptions + return *o.MountOptions.Get() } // GetMountOptionsOk returns a tuple with the MountOptions field value if set, nil otherwise // 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 *CSIVolume) GetMountOptionsOk() (*CSIMountOptions, bool) { - if o == nil || o.MountOptions == nil { + if o == nil { return nil, false } - return o.MountOptions, true + return o.MountOptions.Get(), o.MountOptions.IsSet() } // HasMountOptions returns a boolean if a field has been set. func (o *CSIVolume) HasMountOptions() bool { - if o != nil && o.MountOptions != nil { + if o != nil && o.MountOptions.IsSet() { return true } return false } -// SetMountOptions gets a reference to the given CSIMountOptions and assigns it to the MountOptions field. +// SetMountOptions gets a reference to the given NullableCSIMountOptions and assigns it to the MountOptions field. func (o *CSIVolume) SetMountOptions(v CSIMountOptions) { - o.MountOptions = &v + o.MountOptions.Set(&v) +} +// SetMountOptionsNil sets the value for MountOptions to be an explicit nil +func (o *CSIVolume) SetMountOptionsNil() { + o.MountOptions.Set(nil) +} + +// UnsetMountOptions ensures that no value is present for MountOptions, not even an explicit nil +func (o *CSIVolume) UnsetMountOptions() { + o.MountOptions.Unset() } // GetName returns the Name field value if set, zero value otherwise. @@ -812,12 +822,12 @@ func (o *CSIVolume) GetRequestedCapabilities() []CSIVolumeCapability { var ret []CSIVolumeCapability return ret } - return *o.RequestedCapabilities + return o.RequestedCapabilities } // GetRequestedCapabilitiesOk returns a tuple with the RequestedCapabilities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolume) GetRequestedCapabilitiesOk() (*[]CSIVolumeCapability, bool) { +func (o *CSIVolume) GetRequestedCapabilitiesOk() ([]CSIVolumeCapability, bool) { if o == nil || o.RequestedCapabilities == nil { return nil, false } @@ -835,7 +845,7 @@ func (o *CSIVolume) HasRequestedCapabilities() bool { // SetRequestedCapabilities gets a reference to the given []CSIVolumeCapability and assigns it to the RequestedCapabilities field. func (o *CSIVolume) SetRequestedCapabilities(v []CSIVolumeCapability) { - o.RequestedCapabilities = &v + o.RequestedCapabilities = v } // GetRequestedCapacityMax returns the RequestedCapacityMax field value if set, zero value otherwise. @@ -902,68 +912,88 @@ func (o *CSIVolume) SetRequestedCapacityMin(v int64) { o.RequestedCapacityMin = &v } -// GetRequestedTopologies returns the RequestedTopologies field value if set, zero value otherwise. +// GetRequestedTopologies returns the RequestedTopologies field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIVolume) GetRequestedTopologies() CSITopologyRequest { - if o == nil || o.RequestedTopologies == nil { + if o == nil || o.RequestedTopologies.Get() == nil { var ret CSITopologyRequest return ret } - return *o.RequestedTopologies + return *o.RequestedTopologies.Get() } // GetRequestedTopologiesOk returns a tuple with the RequestedTopologies field value if set, nil otherwise // 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 *CSIVolume) GetRequestedTopologiesOk() (*CSITopologyRequest, bool) { - if o == nil || o.RequestedTopologies == nil { + if o == nil { return nil, false } - return o.RequestedTopologies, true + return o.RequestedTopologies.Get(), o.RequestedTopologies.IsSet() } // HasRequestedTopologies returns a boolean if a field has been set. func (o *CSIVolume) HasRequestedTopologies() bool { - if o != nil && o.RequestedTopologies != nil { + if o != nil && o.RequestedTopologies.IsSet() { return true } return false } -// SetRequestedTopologies gets a reference to the given CSITopologyRequest and assigns it to the RequestedTopologies field. +// SetRequestedTopologies gets a reference to the given NullableCSITopologyRequest and assigns it to the RequestedTopologies field. func (o *CSIVolume) SetRequestedTopologies(v CSITopologyRequest) { - o.RequestedTopologies = &v + o.RequestedTopologies.Set(&v) +} +// SetRequestedTopologiesNil sets the value for RequestedTopologies to be an explicit nil +func (o *CSIVolume) SetRequestedTopologiesNil() { + o.RequestedTopologies.Set(nil) } -// GetResourceExhausted returns the ResourceExhausted field value if set, zero value otherwise. +// UnsetRequestedTopologies ensures that no value is present for RequestedTopologies, not even an explicit nil +func (o *CSIVolume) UnsetRequestedTopologies() { + o.RequestedTopologies.Unset() +} + +// GetResourceExhausted returns the ResourceExhausted field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIVolume) GetResourceExhausted() time.Time { - if o == nil || o.ResourceExhausted == nil { + if o == nil || o.ResourceExhausted.Get() == nil { var ret time.Time return ret } - return *o.ResourceExhausted + return *o.ResourceExhausted.Get() } // GetResourceExhaustedOk returns a tuple with the ResourceExhausted field value if set, nil otherwise // 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 *CSIVolume) GetResourceExhaustedOk() (*time.Time, bool) { - if o == nil || o.ResourceExhausted == nil { + if o == nil { return nil, false } - return o.ResourceExhausted, true + return o.ResourceExhausted.Get(), o.ResourceExhausted.IsSet() } // HasResourceExhausted returns a boolean if a field has been set. func (o *CSIVolume) HasResourceExhausted() bool { - if o != nil && o.ResourceExhausted != nil { + if o != nil && o.ResourceExhausted.IsSet() { return true } return false } -// SetResourceExhausted gets a reference to the given time.Time and assigns it to the ResourceExhausted field. +// SetResourceExhausted gets a reference to the given NullableTime and assigns it to the ResourceExhausted field. func (o *CSIVolume) SetResourceExhausted(v time.Time) { - o.ResourceExhausted = &v + o.ResourceExhausted.Set(&v) +} +// SetResourceExhaustedNil sets the value for ResourceExhausted to be an explicit nil +func (o *CSIVolume) SetResourceExhaustedNil() { + o.ResourceExhausted.Set(nil) +} + +// UnsetResourceExhausted ensures that no value is present for ResourceExhausted, not even an explicit nil +func (o *CSIVolume) UnsetResourceExhausted() { + o.ResourceExhausted.Unset() } // GetSchedulable returns the Schedulable field value if set, zero value otherwise. @@ -1068,12 +1098,12 @@ func (o *CSIVolume) GetTopologies() []CSITopology { var ret []CSITopology return ret } - return *o.Topologies + return o.Topologies } // GetTopologiesOk returns a tuple with the Topologies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolume) GetTopologiesOk() (*[]CSITopology, bool) { +func (o *CSIVolume) GetTopologiesOk() ([]CSITopology, bool) { if o == nil || o.Topologies == nil { return nil, false } @@ -1091,7 +1121,7 @@ func (o *CSIVolume) HasTopologies() bool { // SetTopologies gets a reference to the given []CSITopology and assigns it to the Topologies field. func (o *CSIVolume) SetTopologies(v []CSITopology) { - o.Topologies = &v + o.Topologies = v } // GetWriteAllocs returns the WriteAllocs field value if set, zero value otherwise. @@ -1167,8 +1197,8 @@ func (o CSIVolume) MarshalJSON() ([]byte, error) { if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex } - if o.MountOptions != nil { - toSerialize["MountOptions"] = o.MountOptions + if o.MountOptions.IsSet() { + toSerialize["MountOptions"] = o.MountOptions.Get() } if o.Name != nil { toSerialize["Name"] = o.Name @@ -1206,11 +1236,11 @@ func (o CSIVolume) MarshalJSON() ([]byte, error) { if o.RequestedCapacityMin != nil { toSerialize["RequestedCapacityMin"] = o.RequestedCapacityMin } - if o.RequestedTopologies != nil { - toSerialize["RequestedTopologies"] = o.RequestedTopologies + if o.RequestedTopologies.IsSet() { + toSerialize["RequestedTopologies"] = o.RequestedTopologies.Get() } - if o.ResourceExhausted != nil { - toSerialize["ResourceExhausted"] = o.ResourceExhausted + if o.ResourceExhausted.IsSet() { + toSerialize["ResourceExhausted"] = o.ResourceExhausted.Get() } if o.Schedulable != nil { toSerialize["Schedulable"] = o.Schedulable diff --git a/clients/go/v1/model_csi_volume_capability.go b/clients/go/v1/model_csi_volume_capability.go index 0c42497c..36fcdddb 100644 --- a/clients/go/v1/model_csi_volume_capability.go +++ b/clients/go/v1/model_csi_volume_capability.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_csi_volume_create_request.go b/clients/go/v1/model_csi_volume_create_request.go index a1214c9d..06f0071e 100644 --- a/clients/go/v1/model_csi_volume_create_request.go +++ b/clients/go/v1/model_csi_volume_create_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ type CSIVolumeCreateRequest struct { Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` SecretID *string `json:"SecretID,omitempty"` - Volumes *[]CSIVolume `json:"Volumes,omitempty"` + Volumes []CSIVolume `json:"Volumes,omitempty"` } // NewCSIVolumeCreateRequest instantiates a new CSIVolumeCreateRequest object @@ -142,12 +142,12 @@ func (o *CSIVolumeCreateRequest) GetVolumes() []CSIVolume { var ret []CSIVolume return ret } - return *o.Volumes + return o.Volumes } // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolumeCreateRequest) GetVolumesOk() (*[]CSIVolume, bool) { +func (o *CSIVolumeCreateRequest) GetVolumesOk() ([]CSIVolume, bool) { if o == nil || o.Volumes == nil { return nil, false } @@ -165,7 +165,7 @@ func (o *CSIVolumeCreateRequest) HasVolumes() bool { // SetVolumes gets a reference to the given []CSIVolume and assigns it to the Volumes field. func (o *CSIVolumeCreateRequest) SetVolumes(v []CSIVolume) { - o.Volumes = &v + o.Volumes = v } func (o CSIVolumeCreateRequest) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_volume_external_stub.go b/clients/go/v1/model_csi_volume_external_stub.go index deba709d..92493beb 100644 --- a/clients/go/v1/model_csi_volume_external_stub.go +++ b/clients/go/v1/model_csi_volume_external_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,7 +21,7 @@ type CSIVolumeExternalStub struct { CloneID *string `json:"CloneID,omitempty"` ExternalID *string `json:"ExternalID,omitempty"` IsAbnormal *bool `json:"IsAbnormal,omitempty"` - PublishedExternalNodeIDs *[]string `json:"PublishedExternalNodeIDs,omitempty"` + PublishedExternalNodeIDs []string `json:"PublishedExternalNodeIDs,omitempty"` SnapshotID *string `json:"SnapshotID,omitempty"` Status *string `json:"Status,omitempty"` VolumeContext *map[string]string `json:"VolumeContext,omitempty"` @@ -178,12 +178,12 @@ func (o *CSIVolumeExternalStub) GetPublishedExternalNodeIDs() []string { var ret []string return ret } - return *o.PublishedExternalNodeIDs + return o.PublishedExternalNodeIDs } // GetPublishedExternalNodeIDsOk returns a tuple with the PublishedExternalNodeIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolumeExternalStub) GetPublishedExternalNodeIDsOk() (*[]string, bool) { +func (o *CSIVolumeExternalStub) GetPublishedExternalNodeIDsOk() ([]string, bool) { if o == nil || o.PublishedExternalNodeIDs == nil { return nil, false } @@ -201,7 +201,7 @@ func (o *CSIVolumeExternalStub) HasPublishedExternalNodeIDs() bool { // SetPublishedExternalNodeIDs gets a reference to the given []string and assigns it to the PublishedExternalNodeIDs field. func (o *CSIVolumeExternalStub) SetPublishedExternalNodeIDs(v []string) { - o.PublishedExternalNodeIDs = &v + o.PublishedExternalNodeIDs = v } // GetSnapshotID returns the SnapshotID field value if set, zero value otherwise. diff --git a/clients/go/v1/model_csi_volume_list_external_response.go b/clients/go/v1/model_csi_volume_list_external_response.go index 7bb13df3..8c9c0d96 100644 --- a/clients/go/v1/model_csi_volume_list_external_response.go +++ b/clients/go/v1/model_csi_volume_list_external_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // CSIVolumeListExternalResponse struct for CSIVolumeListExternalResponse type CSIVolumeListExternalResponse struct { NextToken *string `json:"NextToken,omitempty"` - Volumes *[]CSIVolumeExternalStub `json:"Volumes,omitempty"` + Volumes []CSIVolumeExternalStub `json:"Volumes,omitempty"` } // NewCSIVolumeListExternalResponse instantiates a new CSIVolumeListExternalResponse object @@ -76,12 +76,12 @@ func (o *CSIVolumeListExternalResponse) GetVolumes() []CSIVolumeExternalStub { var ret []CSIVolumeExternalStub return ret } - return *o.Volumes + return o.Volumes } // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolumeListExternalResponse) GetVolumesOk() (*[]CSIVolumeExternalStub, bool) { +func (o *CSIVolumeListExternalResponse) GetVolumesOk() ([]CSIVolumeExternalStub, bool) { if o == nil || o.Volumes == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *CSIVolumeListExternalResponse) HasVolumes() bool { // SetVolumes gets a reference to the given []CSIVolumeExternalStub and assigns it to the Volumes field. func (o *CSIVolumeListExternalResponse) SetVolumes(v []CSIVolumeExternalStub) { - o.Volumes = &v + o.Volumes = v } func (o CSIVolumeListExternalResponse) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_csi_volume_list_stub.go b/clients/go/v1/model_csi_volume_list_stub.go index 86d2fad8..23f2aca2 100644 --- a/clients/go/v1/model_csi_volume_list_stub.go +++ b/clients/go/v1/model_csi_volume_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -33,9 +33,9 @@ type CSIVolumeListStub struct { NodesHealthy *int32 `json:"NodesHealthy,omitempty"` PluginID *string `json:"PluginID,omitempty"` Provider *string `json:"Provider,omitempty"` - ResourceExhausted *time.Time `json:"ResourceExhausted,omitempty"` + ResourceExhausted NullableTime `json:"ResourceExhausted,omitempty"` Schedulable *bool `json:"Schedulable,omitempty"` - Topologies *[]CSITopology `json:"Topologies,omitempty"` + Topologies []CSITopology `json:"Topologies,omitempty"` } // NewCSIVolumeListStub instantiates a new CSIVolumeListStub object @@ -535,36 +535,46 @@ func (o *CSIVolumeListStub) SetProvider(v string) { o.Provider = &v } -// GetResourceExhausted returns the ResourceExhausted field value if set, zero value otherwise. +// GetResourceExhausted returns the ResourceExhausted field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CSIVolumeListStub) GetResourceExhausted() time.Time { - if o == nil || o.ResourceExhausted == nil { + if o == nil || o.ResourceExhausted.Get() == nil { var ret time.Time return ret } - return *o.ResourceExhausted + return *o.ResourceExhausted.Get() } // GetResourceExhaustedOk returns a tuple with the ResourceExhausted field value if set, nil otherwise // 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 *CSIVolumeListStub) GetResourceExhaustedOk() (*time.Time, bool) { - if o == nil || o.ResourceExhausted == nil { + if o == nil { return nil, false } - return o.ResourceExhausted, true + return o.ResourceExhausted.Get(), o.ResourceExhausted.IsSet() } // HasResourceExhausted returns a boolean if a field has been set. func (o *CSIVolumeListStub) HasResourceExhausted() bool { - if o != nil && o.ResourceExhausted != nil { + if o != nil && o.ResourceExhausted.IsSet() { return true } return false } -// SetResourceExhausted gets a reference to the given time.Time and assigns it to the ResourceExhausted field. +// SetResourceExhausted gets a reference to the given NullableTime and assigns it to the ResourceExhausted field. func (o *CSIVolumeListStub) SetResourceExhausted(v time.Time) { - o.ResourceExhausted = &v + o.ResourceExhausted.Set(&v) +} +// SetResourceExhaustedNil sets the value for ResourceExhausted to be an explicit nil +func (o *CSIVolumeListStub) SetResourceExhaustedNil() { + o.ResourceExhausted.Set(nil) +} + +// UnsetResourceExhausted ensures that no value is present for ResourceExhausted, not even an explicit nil +func (o *CSIVolumeListStub) UnsetResourceExhausted() { + o.ResourceExhausted.Unset() } // GetSchedulable returns the Schedulable field value if set, zero value otherwise. @@ -605,12 +615,12 @@ func (o *CSIVolumeListStub) GetTopologies() []CSITopology { var ret []CSITopology return ret } - return *o.Topologies + return o.Topologies } // GetTopologiesOk returns a tuple with the Topologies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolumeListStub) GetTopologiesOk() (*[]CSITopology, bool) { +func (o *CSIVolumeListStub) GetTopologiesOk() ([]CSITopology, bool) { if o == nil || o.Topologies == nil { return nil, false } @@ -628,7 +638,7 @@ func (o *CSIVolumeListStub) HasTopologies() bool { // SetTopologies gets a reference to the given []CSITopology and assigns it to the Topologies field. func (o *CSIVolumeListStub) SetTopologies(v []CSITopology) { - o.Topologies = &v + o.Topologies = v } func (o CSIVolumeListStub) MarshalJSON() ([]byte, error) { @@ -678,8 +688,8 @@ func (o CSIVolumeListStub) MarshalJSON() ([]byte, error) { if o.Provider != nil { toSerialize["Provider"] = o.Provider } - if o.ResourceExhausted != nil { - toSerialize["ResourceExhausted"] = o.ResourceExhausted + if o.ResourceExhausted.IsSet() { + toSerialize["ResourceExhausted"] = o.ResourceExhausted.Get() } if o.Schedulable != nil { toSerialize["Schedulable"] = o.Schedulable diff --git a/clients/go/v1/model_csi_volume_register_request.go b/clients/go/v1/model_csi_volume_register_request.go index da411775..c4ce91e7 100644 --- a/clients/go/v1/model_csi_volume_register_request.go +++ b/clients/go/v1/model_csi_volume_register_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ type CSIVolumeRegisterRequest struct { Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` SecretID *string `json:"SecretID,omitempty"` - Volumes *[]CSIVolume `json:"Volumes,omitempty"` + Volumes []CSIVolume `json:"Volumes,omitempty"` } // NewCSIVolumeRegisterRequest instantiates a new CSIVolumeRegisterRequest object @@ -142,12 +142,12 @@ func (o *CSIVolumeRegisterRequest) GetVolumes() []CSIVolume { var ret []CSIVolume return ret } - return *o.Volumes + return o.Volumes } // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CSIVolumeRegisterRequest) GetVolumesOk() (*[]CSIVolume, bool) { +func (o *CSIVolumeRegisterRequest) GetVolumesOk() ([]CSIVolume, bool) { if o == nil || o.Volumes == nil { return nil, false } @@ -165,7 +165,7 @@ func (o *CSIVolumeRegisterRequest) HasVolumes() bool { // SetVolumes gets a reference to the given []CSIVolume and assigns it to the Volumes field. func (o *CSIVolumeRegisterRequest) SetVolumes(v []CSIVolume) { - o.Volumes = &v + o.Volumes = v } func (o CSIVolumeRegisterRequest) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_deployment.go b/clients/go/v1/model_deployment.go index cbcd91a6..bcf5da46 100644 --- a/clients/go/v1/model_deployment.go +++ b/clients/go/v1/model_deployment.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_deployment_alloc_health_request.go b/clients/go/v1/model_deployment_alloc_health_request.go index 3552ca59..1699abc4 100644 --- a/clients/go/v1/model_deployment_alloc_health_request.go +++ b/clients/go/v1/model_deployment_alloc_health_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,11 +18,11 @@ import ( // DeploymentAllocHealthRequest struct for DeploymentAllocHealthRequest type DeploymentAllocHealthRequest struct { DeploymentID *string `json:"DeploymentID,omitempty"` - HealthyAllocationIDs *[]string `json:"HealthyAllocationIDs,omitempty"` + HealthyAllocationIDs []string `json:"HealthyAllocationIDs,omitempty"` Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` SecretID *string `json:"SecretID,omitempty"` - UnhealthyAllocationIDs *[]string `json:"UnhealthyAllocationIDs,omitempty"` + UnhealthyAllocationIDs []string `json:"UnhealthyAllocationIDs,omitempty"` } // NewDeploymentAllocHealthRequest instantiates a new DeploymentAllocHealthRequest object @@ -80,12 +80,12 @@ func (o *DeploymentAllocHealthRequest) GetHealthyAllocationIDs() []string { var ret []string return ret } - return *o.HealthyAllocationIDs + return o.HealthyAllocationIDs } // GetHealthyAllocationIDsOk returns a tuple with the HealthyAllocationIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentAllocHealthRequest) GetHealthyAllocationIDsOk() (*[]string, bool) { +func (o *DeploymentAllocHealthRequest) GetHealthyAllocationIDsOk() ([]string, bool) { if o == nil || o.HealthyAllocationIDs == nil { return nil, false } @@ -103,7 +103,7 @@ func (o *DeploymentAllocHealthRequest) HasHealthyAllocationIDs() bool { // SetHealthyAllocationIDs gets a reference to the given []string and assigns it to the HealthyAllocationIDs field. func (o *DeploymentAllocHealthRequest) SetHealthyAllocationIDs(v []string) { - o.HealthyAllocationIDs = &v + o.HealthyAllocationIDs = v } // GetNamespace returns the Namespace field value if set, zero value otherwise. @@ -208,12 +208,12 @@ func (o *DeploymentAllocHealthRequest) GetUnhealthyAllocationIDs() []string { var ret []string return ret } - return *o.UnhealthyAllocationIDs + return o.UnhealthyAllocationIDs } // GetUnhealthyAllocationIDsOk returns a tuple with the UnhealthyAllocationIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentAllocHealthRequest) GetUnhealthyAllocationIDsOk() (*[]string, bool) { +func (o *DeploymentAllocHealthRequest) GetUnhealthyAllocationIDsOk() ([]string, bool) { if o == nil || o.UnhealthyAllocationIDs == nil { return nil, false } @@ -231,7 +231,7 @@ func (o *DeploymentAllocHealthRequest) HasUnhealthyAllocationIDs() bool { // SetUnhealthyAllocationIDs gets a reference to the given []string and assigns it to the UnhealthyAllocationIDs field. func (o *DeploymentAllocHealthRequest) SetUnhealthyAllocationIDs(v []string) { - o.UnhealthyAllocationIDs = &v + o.UnhealthyAllocationIDs = v } func (o DeploymentAllocHealthRequest) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_deployment_pause_request.go b/clients/go/v1/model_deployment_pause_request.go index b505d576..08313f2c 100644 --- a/clients/go/v1/model_deployment_pause_request.go +++ b/clients/go/v1/model_deployment_pause_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_deployment_promote_request.go b/clients/go/v1/model_deployment_promote_request.go index 729ef9be..c8c283d4 100644 --- a/clients/go/v1/model_deployment_promote_request.go +++ b/clients/go/v1/model_deployment_promote_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type DeploymentPromoteRequest struct { All *bool `json:"All,omitempty"` DeploymentID *string `json:"DeploymentID,omitempty"` - Groups *[]string `json:"Groups,omitempty"` + Groups []string `json:"Groups,omitempty"` Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` SecretID *string `json:"SecretID,omitempty"` @@ -112,12 +112,12 @@ func (o *DeploymentPromoteRequest) GetGroups() []string { var ret []string return ret } - return *o.Groups + return o.Groups } // GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentPromoteRequest) GetGroupsOk() (*[]string, bool) { +func (o *DeploymentPromoteRequest) GetGroupsOk() ([]string, bool) { if o == nil || o.Groups == nil { return nil, false } @@ -135,7 +135,7 @@ func (o *DeploymentPromoteRequest) HasGroups() bool { // SetGroups gets a reference to the given []string and assigns it to the Groups field. func (o *DeploymentPromoteRequest) SetGroups(v []string) { - o.Groups = &v + o.Groups = v } // GetNamespace returns the Namespace field value if set, zero value otherwise. diff --git a/clients/go/v1/model_deployment_state.go b/clients/go/v1/model_deployment_state.go index 785b59d6..ee5374fd 100644 --- a/clients/go/v1/model_deployment_state.go +++ b/clients/go/v1/model_deployment_state.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,10 +23,10 @@ type DeploymentState struct { DesiredTotal *int32 `json:"DesiredTotal,omitempty"` HealthyAllocs *int32 `json:"HealthyAllocs,omitempty"` PlacedAllocs *int32 `json:"PlacedAllocs,omitempty"` - PlacedCanaries *[]string `json:"PlacedCanaries,omitempty"` + PlacedCanaries []string `json:"PlacedCanaries,omitempty"` ProgressDeadline *int64 `json:"ProgressDeadline,omitempty"` Promoted *bool `json:"Promoted,omitempty"` - RequireProgressBy *time.Time `json:"RequireProgressBy,omitempty"` + RequireProgressBy NullableTime `json:"RequireProgressBy,omitempty"` UnhealthyAllocs *int32 `json:"UnhealthyAllocs,omitempty"` } @@ -213,12 +213,12 @@ func (o *DeploymentState) GetPlacedCanaries() []string { var ret []string return ret } - return *o.PlacedCanaries + return o.PlacedCanaries } // GetPlacedCanariesOk returns a tuple with the PlacedCanaries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentState) GetPlacedCanariesOk() (*[]string, bool) { +func (o *DeploymentState) GetPlacedCanariesOk() ([]string, bool) { if o == nil || o.PlacedCanaries == nil { return nil, false } @@ -236,7 +236,7 @@ func (o *DeploymentState) HasPlacedCanaries() bool { // SetPlacedCanaries gets a reference to the given []string and assigns it to the PlacedCanaries field. func (o *DeploymentState) SetPlacedCanaries(v []string) { - o.PlacedCanaries = &v + o.PlacedCanaries = v } // GetProgressDeadline returns the ProgressDeadline field value if set, zero value otherwise. @@ -303,36 +303,46 @@ func (o *DeploymentState) SetPromoted(v bool) { o.Promoted = &v } -// GetRequireProgressBy returns the RequireProgressBy field value if set, zero value otherwise. +// GetRequireProgressBy returns the RequireProgressBy field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeploymentState) GetRequireProgressBy() time.Time { - if o == nil || o.RequireProgressBy == nil { + if o == nil || o.RequireProgressBy.Get() == nil { var ret time.Time return ret } - return *o.RequireProgressBy + return *o.RequireProgressBy.Get() } // GetRequireProgressByOk returns a tuple with the RequireProgressBy field value if set, nil otherwise // 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 *DeploymentState) GetRequireProgressByOk() (*time.Time, bool) { - if o == nil || o.RequireProgressBy == nil { + if o == nil { return nil, false } - return o.RequireProgressBy, true + return o.RequireProgressBy.Get(), o.RequireProgressBy.IsSet() } // HasRequireProgressBy returns a boolean if a field has been set. func (o *DeploymentState) HasRequireProgressBy() bool { - if o != nil && o.RequireProgressBy != nil { + if o != nil && o.RequireProgressBy.IsSet() { return true } return false } -// SetRequireProgressBy gets a reference to the given time.Time and assigns it to the RequireProgressBy field. +// SetRequireProgressBy gets a reference to the given NullableTime and assigns it to the RequireProgressBy field. func (o *DeploymentState) SetRequireProgressBy(v time.Time) { - o.RequireProgressBy = &v + o.RequireProgressBy.Set(&v) +} +// SetRequireProgressByNil sets the value for RequireProgressBy to be an explicit nil +func (o *DeploymentState) SetRequireProgressByNil() { + o.RequireProgressBy.Set(nil) +} + +// UnsetRequireProgressBy ensures that no value is present for RequireProgressBy, not even an explicit nil +func (o *DeploymentState) UnsetRequireProgressBy() { + o.RequireProgressBy.Unset() } // GetUnhealthyAllocs returns the UnhealthyAllocs field value if set, zero value otherwise. @@ -393,8 +403,8 @@ func (o DeploymentState) MarshalJSON() ([]byte, error) { if o.Promoted != nil { toSerialize["Promoted"] = o.Promoted } - if o.RequireProgressBy != nil { - toSerialize["RequireProgressBy"] = o.RequireProgressBy + if o.RequireProgressBy.IsSet() { + toSerialize["RequireProgressBy"] = o.RequireProgressBy.Get() } if o.UnhealthyAllocs != nil { toSerialize["UnhealthyAllocs"] = o.UnhealthyAllocs diff --git a/clients/go/v1/model_deployment_unblock_request.go b/clients/go/v1/model_deployment_unblock_request.go index 962353d0..7afb807a 100644 --- a/clients/go/v1/model_deployment_unblock_request.go +++ b/clients/go/v1/model_deployment_unblock_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_deployment_update_response.go b/clients/go/v1/model_deployment_update_response.go index bcd0a9fe..c339f673 100644 --- a/clients/go/v1/model_deployment_update_response.go +++ b/clients/go/v1/model_deployment_update_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_desired_transition.go b/clients/go/v1/model_desired_transition.go index e1b1b30a..a51c12e1 100644 --- a/clients/go/v1/model_desired_transition.go +++ b/clients/go/v1/model_desired_transition.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_desired_updates.go b/clients/go/v1/model_desired_updates.go index f57e4a42..c5443c6b 100644 --- a/clients/go/v1/model_desired_updates.go +++ b/clients/go/v1/model_desired_updates.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_dispatch_payload_config.go b/clients/go/v1/model_dispatch_payload_config.go index 75f523b8..a016ba03 100644 --- a/clients/go/v1/model_dispatch_payload_config.go +++ b/clients/go/v1/model_dispatch_payload_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_dns_config.go b/clients/go/v1/model_dns_config.go index 092e7d3f..c9b6e211 100644 --- a/clients/go/v1/model_dns_config.go +++ b/clients/go/v1/model_dns_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,9 @@ import ( // DNSConfig struct for DNSConfig type DNSConfig struct { - Options *[]string `json:"Options,omitempty"` - Searches *[]string `json:"Searches,omitempty"` - Servers *[]string `json:"Servers,omitempty"` + Options []string `json:"Options,omitempty"` + Searches []string `json:"Searches,omitempty"` + Servers []string `json:"Servers,omitempty"` } // NewDNSConfig instantiates a new DNSConfig object @@ -45,12 +45,12 @@ func (o *DNSConfig) GetOptions() []string { var ret []string return ret } - return *o.Options + return o.Options } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DNSConfig) GetOptionsOk() (*[]string, bool) { +func (o *DNSConfig) GetOptionsOk() ([]string, bool) { if o == nil || o.Options == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *DNSConfig) HasOptions() bool { // SetOptions gets a reference to the given []string and assigns it to the Options field. func (o *DNSConfig) SetOptions(v []string) { - o.Options = &v + o.Options = v } // GetSearches returns the Searches field value if set, zero value otherwise. @@ -77,12 +77,12 @@ func (o *DNSConfig) GetSearches() []string { var ret []string return ret } - return *o.Searches + return o.Searches } // GetSearchesOk returns a tuple with the Searches field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DNSConfig) GetSearchesOk() (*[]string, bool) { +func (o *DNSConfig) GetSearchesOk() ([]string, bool) { if o == nil || o.Searches == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *DNSConfig) HasSearches() bool { // SetSearches gets a reference to the given []string and assigns it to the Searches field. func (o *DNSConfig) SetSearches(v []string) { - o.Searches = &v + o.Searches = v } // GetServers returns the Servers field value if set, zero value otherwise. @@ -109,12 +109,12 @@ func (o *DNSConfig) GetServers() []string { var ret []string return ret } - return *o.Servers + return o.Servers } // GetServersOk returns a tuple with the Servers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DNSConfig) GetServersOk() (*[]string, bool) { +func (o *DNSConfig) GetServersOk() ([]string, bool) { if o == nil || o.Servers == nil { return nil, false } @@ -132,7 +132,7 @@ func (o *DNSConfig) HasServers() bool { // SetServers gets a reference to the given []string and assigns it to the Servers field. func (o *DNSConfig) SetServers(v []string) { - o.Servers = &v + o.Servers = v } func (o DNSConfig) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_drain_metadata.go b/clients/go/v1/model_drain_metadata.go index 028a6844..d56e8f4b 100644 --- a/clients/go/v1/model_drain_metadata.go +++ b/clients/go/v1/model_drain_metadata.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,9 +20,9 @@ import ( type DrainMetadata struct { AccessorID *string `json:"AccessorID,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` - StartedAt *time.Time `json:"StartedAt,omitempty"` + StartedAt NullableTime `json:"StartedAt,omitempty"` Status *string `json:"Status,omitempty"` - UpdatedAt *time.Time `json:"UpdatedAt,omitempty"` + UpdatedAt NullableTime `json:"UpdatedAt,omitempty"` } // NewDrainMetadata instantiates a new DrainMetadata object @@ -106,36 +106,46 @@ func (o *DrainMetadata) SetMeta(v map[string]string) { o.Meta = &v } -// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +// GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DrainMetadata) GetStartedAt() time.Time { - if o == nil || o.StartedAt == nil { + if o == nil || o.StartedAt.Get() == nil { var ret time.Time return ret } - return *o.StartedAt + return *o.StartedAt.Get() } // GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise // 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 *DrainMetadata) GetStartedAtOk() (*time.Time, bool) { - if o == nil || o.StartedAt == nil { + if o == nil { return nil, false } - return o.StartedAt, true + return o.StartedAt.Get(), o.StartedAt.IsSet() } // HasStartedAt returns a boolean if a field has been set. func (o *DrainMetadata) HasStartedAt() bool { - if o != nil && o.StartedAt != nil { + if o != nil && o.StartedAt.IsSet() { return true } return false } -// SetStartedAt gets a reference to the given time.Time and assigns it to the StartedAt field. +// SetStartedAt gets a reference to the given NullableTime and assigns it to the StartedAt field. func (o *DrainMetadata) SetStartedAt(v time.Time) { - o.StartedAt = &v + o.StartedAt.Set(&v) +} +// SetStartedAtNil sets the value for StartedAt to be an explicit nil +func (o *DrainMetadata) SetStartedAtNil() { + o.StartedAt.Set(nil) +} + +// UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil +func (o *DrainMetadata) UnsetStartedAt() { + o.StartedAt.Unset() } // GetStatus returns the Status field value if set, zero value otherwise. @@ -170,36 +180,46 @@ func (o *DrainMetadata) SetStatus(v string) { o.Status = &v } -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DrainMetadata) GetUpdatedAt() time.Time { - if o == nil || o.UpdatedAt == nil { + if o == nil || o.UpdatedAt.Get() == nil { var ret time.Time return ret } - return *o.UpdatedAt + return *o.UpdatedAt.Get() } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // 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 *DrainMetadata) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || o.UpdatedAt == nil { + if o == nil { return nil, false } - return o.UpdatedAt, true + return o.UpdatedAt.Get(), o.UpdatedAt.IsSet() } // HasUpdatedAt returns a boolean if a field has been set. func (o *DrainMetadata) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { + if o != nil && o.UpdatedAt.IsSet() { return true } return false } -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// SetUpdatedAt gets a reference to the given NullableTime and assigns it to the UpdatedAt field. func (o *DrainMetadata) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v + o.UpdatedAt.Set(&v) +} +// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil +func (o *DrainMetadata) SetUpdatedAtNil() { + o.UpdatedAt.Set(nil) +} + +// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +func (o *DrainMetadata) UnsetUpdatedAt() { + o.UpdatedAt.Unset() } func (o DrainMetadata) MarshalJSON() ([]byte, error) { @@ -210,14 +230,14 @@ func (o DrainMetadata) MarshalJSON() ([]byte, error) { if o.Meta != nil { toSerialize["Meta"] = o.Meta } - if o.StartedAt != nil { - toSerialize["StartedAt"] = o.StartedAt + if o.StartedAt.IsSet() { + toSerialize["StartedAt"] = o.StartedAt.Get() } if o.Status != nil { toSerialize["Status"] = o.Status } - if o.UpdatedAt != nil { - toSerialize["UpdatedAt"] = o.UpdatedAt + if o.UpdatedAt.IsSet() { + toSerialize["UpdatedAt"] = o.UpdatedAt.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_drain_spec.go b/clients/go/v1/model_drain_spec.go index 6e97ef7c..771f5a53 100644 --- a/clients/go/v1/model_drain_spec.go +++ b/clients/go/v1/model_drain_spec.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_drain_strategy.go b/clients/go/v1/model_drain_strategy.go index 1d7e93d4..cffd370f 100644 --- a/clients/go/v1/model_drain_strategy.go +++ b/clients/go/v1/model_drain_strategy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,9 @@ import ( // DrainStrategy struct for DrainStrategy type DrainStrategy struct { Deadline *int64 `json:"Deadline,omitempty"` - ForceDeadline *time.Time `json:"ForceDeadline,omitempty"` + ForceDeadline NullableTime `json:"ForceDeadline,omitempty"` IgnoreSystemJobs *bool `json:"IgnoreSystemJobs,omitempty"` - StartedAt *time.Time `json:"StartedAt,omitempty"` + StartedAt NullableTime `json:"StartedAt,omitempty"` } // NewDrainStrategy instantiates a new DrainStrategy object @@ -73,36 +73,46 @@ func (o *DrainStrategy) SetDeadline(v int64) { o.Deadline = &v } -// GetForceDeadline returns the ForceDeadline field value if set, zero value otherwise. +// GetForceDeadline returns the ForceDeadline field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DrainStrategy) GetForceDeadline() time.Time { - if o == nil || o.ForceDeadline == nil { + if o == nil || o.ForceDeadline.Get() == nil { var ret time.Time return ret } - return *o.ForceDeadline + return *o.ForceDeadline.Get() } // GetForceDeadlineOk returns a tuple with the ForceDeadline field value if set, nil otherwise // 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 *DrainStrategy) GetForceDeadlineOk() (*time.Time, bool) { - if o == nil || o.ForceDeadline == nil { + if o == nil { return nil, false } - return o.ForceDeadline, true + return o.ForceDeadline.Get(), o.ForceDeadline.IsSet() } // HasForceDeadline returns a boolean if a field has been set. func (o *DrainStrategy) HasForceDeadline() bool { - if o != nil && o.ForceDeadline != nil { + if o != nil && o.ForceDeadline.IsSet() { return true } return false } -// SetForceDeadline gets a reference to the given time.Time and assigns it to the ForceDeadline field. +// SetForceDeadline gets a reference to the given NullableTime and assigns it to the ForceDeadline field. func (o *DrainStrategy) SetForceDeadline(v time.Time) { - o.ForceDeadline = &v + o.ForceDeadline.Set(&v) +} +// SetForceDeadlineNil sets the value for ForceDeadline to be an explicit nil +func (o *DrainStrategy) SetForceDeadlineNil() { + o.ForceDeadline.Set(nil) +} + +// UnsetForceDeadline ensures that no value is present for ForceDeadline, not even an explicit nil +func (o *DrainStrategy) UnsetForceDeadline() { + o.ForceDeadline.Unset() } // GetIgnoreSystemJobs returns the IgnoreSystemJobs field value if set, zero value otherwise. @@ -137,36 +147,46 @@ func (o *DrainStrategy) SetIgnoreSystemJobs(v bool) { o.IgnoreSystemJobs = &v } -// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +// GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DrainStrategy) GetStartedAt() time.Time { - if o == nil || o.StartedAt == nil { + if o == nil || o.StartedAt.Get() == nil { var ret time.Time return ret } - return *o.StartedAt + return *o.StartedAt.Get() } // GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise // 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 *DrainStrategy) GetStartedAtOk() (*time.Time, bool) { - if o == nil || o.StartedAt == nil { + if o == nil { return nil, false } - return o.StartedAt, true + return o.StartedAt.Get(), o.StartedAt.IsSet() } // HasStartedAt returns a boolean if a field has been set. func (o *DrainStrategy) HasStartedAt() bool { - if o != nil && o.StartedAt != nil { + if o != nil && o.StartedAt.IsSet() { return true } return false } -// SetStartedAt gets a reference to the given time.Time and assigns it to the StartedAt field. +// SetStartedAt gets a reference to the given NullableTime and assigns it to the StartedAt field. func (o *DrainStrategy) SetStartedAt(v time.Time) { - o.StartedAt = &v + o.StartedAt.Set(&v) +} +// SetStartedAtNil sets the value for StartedAt to be an explicit nil +func (o *DrainStrategy) SetStartedAtNil() { + o.StartedAt.Set(nil) +} + +// UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil +func (o *DrainStrategy) UnsetStartedAt() { + o.StartedAt.Unset() } func (o DrainStrategy) MarshalJSON() ([]byte, error) { @@ -174,14 +194,14 @@ func (o DrainStrategy) MarshalJSON() ([]byte, error) { if o.Deadline != nil { toSerialize["Deadline"] = o.Deadline } - if o.ForceDeadline != nil { - toSerialize["ForceDeadline"] = o.ForceDeadline + if o.ForceDeadline.IsSet() { + toSerialize["ForceDeadline"] = o.ForceDeadline.Get() } if o.IgnoreSystemJobs != nil { toSerialize["IgnoreSystemJobs"] = o.IgnoreSystemJobs } - if o.StartedAt != nil { - toSerialize["StartedAt"] = o.StartedAt + if o.StartedAt.IsSet() { + toSerialize["StartedAt"] = o.StartedAt.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_driver_info.go b/clients/go/v1/model_driver_info.go index 6ef3b365..bb9b60cb 100644 --- a/clients/go/v1/model_driver_info.go +++ b/clients/go/v1/model_driver_info.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type DriverInfo struct { Detected *bool `json:"Detected,omitempty"` HealthDescription *string `json:"HealthDescription,omitempty"` Healthy *bool `json:"Healthy,omitempty"` - UpdateTime *time.Time `json:"UpdateTime,omitempty"` + UpdateTime NullableTime `json:"UpdateTime,omitempty"` } // NewDriverInfo instantiates a new DriverInfo object @@ -170,36 +170,46 @@ func (o *DriverInfo) SetHealthy(v bool) { o.Healthy = &v } -// GetUpdateTime returns the UpdateTime field value if set, zero value otherwise. +// GetUpdateTime returns the UpdateTime field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DriverInfo) GetUpdateTime() time.Time { - if o == nil || o.UpdateTime == nil { + if o == nil || o.UpdateTime.Get() == nil { var ret time.Time return ret } - return *o.UpdateTime + return *o.UpdateTime.Get() } // GetUpdateTimeOk returns a tuple with the UpdateTime field value if set, nil otherwise // 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 *DriverInfo) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil || o.UpdateTime == nil { + if o == nil { return nil, false } - return o.UpdateTime, true + return o.UpdateTime.Get(), o.UpdateTime.IsSet() } // HasUpdateTime returns a boolean if a field has been set. func (o *DriverInfo) HasUpdateTime() bool { - if o != nil && o.UpdateTime != nil { + if o != nil && o.UpdateTime.IsSet() { return true } return false } -// SetUpdateTime gets a reference to the given time.Time and assigns it to the UpdateTime field. +// SetUpdateTime gets a reference to the given NullableTime and assigns it to the UpdateTime field. func (o *DriverInfo) SetUpdateTime(v time.Time) { - o.UpdateTime = &v + o.UpdateTime.Set(&v) +} +// SetUpdateTimeNil sets the value for UpdateTime to be an explicit nil +func (o *DriverInfo) SetUpdateTimeNil() { + o.UpdateTime.Set(nil) +} + +// UnsetUpdateTime ensures that no value is present for UpdateTime, not even an explicit nil +func (o *DriverInfo) UnsetUpdateTime() { + o.UpdateTime.Unset() } func (o DriverInfo) MarshalJSON() ([]byte, error) { @@ -216,8 +226,8 @@ func (o DriverInfo) MarshalJSON() ([]byte, error) { if o.Healthy != nil { toSerialize["Healthy"] = o.Healthy } - if o.UpdateTime != nil { - toSerialize["UpdateTime"] = o.UpdateTime + if o.UpdateTime.IsSet() { + toSerialize["UpdateTime"] = o.UpdateTime.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_ephemeral_disk.go b/clients/go/v1/model_ephemeral_disk.go index cabcaf49..9df10846 100644 --- a/clients/go/v1/model_ephemeral_disk.go +++ b/clients/go/v1/model_ephemeral_disk.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_eval_options.go b/clients/go/v1/model_eval_options.go index b7522302..90e237ed 100644 --- a/clients/go/v1/model_eval_options.go +++ b/clients/go/v1/model_eval_options.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_evaluation.go b/clients/go/v1/model_evaluation.go index 24c1b197..ef383bdf 100644 --- a/clients/go/v1/model_evaluation.go +++ b/clients/go/v1/model_evaluation.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -39,14 +39,14 @@ type Evaluation struct { Priority *int32 `json:"Priority,omitempty"` QueuedAllocations *map[string]int32 `json:"QueuedAllocations,omitempty"` QuotaLimitReached *string `json:"QuotaLimitReached,omitempty"` - RelatedEvals *[]EvaluationStub `json:"RelatedEvals,omitempty"` + RelatedEvals []EvaluationStub `json:"RelatedEvals,omitempty"` SnapshotIndex *int32 `json:"SnapshotIndex,omitempty"` Status *string `json:"Status,omitempty"` StatusDescription *string `json:"StatusDescription,omitempty"` TriggeredBy *string `json:"TriggeredBy,omitempty"` Type *string `json:"Type,omitempty"` Wait *int64 `json:"Wait,omitempty"` - WaitUntil *time.Time `json:"WaitUntil,omitempty"` + WaitUntil NullableTime `json:"WaitUntil,omitempty"` } // NewEvaluation instantiates a new Evaluation object @@ -744,12 +744,12 @@ func (o *Evaluation) GetRelatedEvals() []EvaluationStub { var ret []EvaluationStub return ret } - return *o.RelatedEvals + return o.RelatedEvals } // GetRelatedEvalsOk returns a tuple with the RelatedEvals field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Evaluation) GetRelatedEvalsOk() (*[]EvaluationStub, bool) { +func (o *Evaluation) GetRelatedEvalsOk() ([]EvaluationStub, bool) { if o == nil || o.RelatedEvals == nil { return nil, false } @@ -767,7 +767,7 @@ func (o *Evaluation) HasRelatedEvals() bool { // SetRelatedEvals gets a reference to the given []EvaluationStub and assigns it to the RelatedEvals field. func (o *Evaluation) SetRelatedEvals(v []EvaluationStub) { - o.RelatedEvals = &v + o.RelatedEvals = v } // GetSnapshotIndex returns the SnapshotIndex field value if set, zero value otherwise. @@ -962,36 +962,46 @@ func (o *Evaluation) SetWait(v int64) { o.Wait = &v } -// GetWaitUntil returns the WaitUntil field value if set, zero value otherwise. +// GetWaitUntil returns the WaitUntil field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Evaluation) GetWaitUntil() time.Time { - if o == nil || o.WaitUntil == nil { + if o == nil || o.WaitUntil.Get() == nil { var ret time.Time return ret } - return *o.WaitUntil + return *o.WaitUntil.Get() } // GetWaitUntilOk returns a tuple with the WaitUntil field value if set, nil otherwise // 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 *Evaluation) GetWaitUntilOk() (*time.Time, bool) { - if o == nil || o.WaitUntil == nil { + if o == nil { return nil, false } - return o.WaitUntil, true + return o.WaitUntil.Get(), o.WaitUntil.IsSet() } // HasWaitUntil returns a boolean if a field has been set. func (o *Evaluation) HasWaitUntil() bool { - if o != nil && o.WaitUntil != nil { + if o != nil && o.WaitUntil.IsSet() { return true } return false } -// SetWaitUntil gets a reference to the given time.Time and assigns it to the WaitUntil field. +// SetWaitUntil gets a reference to the given NullableTime and assigns it to the WaitUntil field. func (o *Evaluation) SetWaitUntil(v time.Time) { - o.WaitUntil = &v + o.WaitUntil.Set(&v) +} +// SetWaitUntilNil sets the value for WaitUntil to be an explicit nil +func (o *Evaluation) SetWaitUntilNil() { + o.WaitUntil.Set(nil) +} + +// UnsetWaitUntil ensures that no value is present for WaitUntil, not even an explicit nil +func (o *Evaluation) UnsetWaitUntil() { + o.WaitUntil.Unset() } func (o Evaluation) MarshalJSON() ([]byte, error) { @@ -1080,8 +1090,8 @@ func (o Evaluation) MarshalJSON() ([]byte, error) { if o.Wait != nil { toSerialize["Wait"] = o.Wait } - if o.WaitUntil != nil { - toSerialize["WaitUntil"] = o.WaitUntil + if o.WaitUntil.IsSet() { + toSerialize["WaitUntil"] = o.WaitUntil.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_evaluation_stub.go b/clients/go/v1/model_evaluation_stub.go index cb8b0519..c567f150 100644 --- a/clients/go/v1/model_evaluation_stub.go +++ b/clients/go/v1/model_evaluation_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -35,7 +35,7 @@ type EvaluationStub struct { StatusDescription *string `json:"StatusDescription,omitempty"` TriggeredBy *string `json:"TriggeredBy,omitempty"` Type *string `json:"Type,omitempty"` - WaitUntil *time.Time `json:"WaitUntil,omitempty"` + WaitUntil NullableTime `json:"WaitUntil,omitempty"` } // NewEvaluationStub instantiates a new EvaluationStub object @@ -599,36 +599,46 @@ func (o *EvaluationStub) SetType(v string) { o.Type = &v } -// GetWaitUntil returns the WaitUntil field value if set, zero value otherwise. +// GetWaitUntil returns the WaitUntil field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EvaluationStub) GetWaitUntil() time.Time { - if o == nil || o.WaitUntil == nil { + if o == nil || o.WaitUntil.Get() == nil { var ret time.Time return ret } - return *o.WaitUntil + return *o.WaitUntil.Get() } // GetWaitUntilOk returns a tuple with the WaitUntil field value if set, nil otherwise // 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 *EvaluationStub) GetWaitUntilOk() (*time.Time, bool) { - if o == nil || o.WaitUntil == nil { + if o == nil { return nil, false } - return o.WaitUntil, true + return o.WaitUntil.Get(), o.WaitUntil.IsSet() } // HasWaitUntil returns a boolean if a field has been set. func (o *EvaluationStub) HasWaitUntil() bool { - if o != nil && o.WaitUntil != nil { + if o != nil && o.WaitUntil.IsSet() { return true } return false } -// SetWaitUntil gets a reference to the given time.Time and assigns it to the WaitUntil field. +// SetWaitUntil gets a reference to the given NullableTime and assigns it to the WaitUntil field. func (o *EvaluationStub) SetWaitUntil(v time.Time) { - o.WaitUntil = &v + o.WaitUntil.Set(&v) +} +// SetWaitUntilNil sets the value for WaitUntil to be an explicit nil +func (o *EvaluationStub) SetWaitUntilNil() { + o.WaitUntil.Set(nil) +} + +// UnsetWaitUntil ensures that no value is present for WaitUntil, not even an explicit nil +func (o *EvaluationStub) UnsetWaitUntil() { + o.WaitUntil.Unset() } func (o EvaluationStub) MarshalJSON() ([]byte, error) { @@ -684,8 +694,8 @@ func (o EvaluationStub) MarshalJSON() ([]byte, error) { if o.Type != nil { toSerialize["Type"] = o.Type } - if o.WaitUntil != nil { - toSerialize["WaitUntil"] = o.WaitUntil + if o.WaitUntil.IsSet() { + toSerialize["WaitUntil"] = o.WaitUntil.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_field_diff.go b/clients/go/v1/model_field_diff.go index 3c998dd4..1aad3b19 100644 --- a/clients/go/v1/model_field_diff.go +++ b/clients/go/v1/model_field_diff.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // FieldDiff struct for FieldDiff type FieldDiff struct { - Annotations *[]string `json:"Annotations,omitempty"` + Annotations []string `json:"Annotations,omitempty"` Name *string `json:"Name,omitempty"` New *string `json:"New,omitempty"` Old *string `json:"Old,omitempty"` @@ -47,12 +47,12 @@ func (o *FieldDiff) GetAnnotations() []string { var ret []string return ret } - return *o.Annotations + return o.Annotations } // GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FieldDiff) GetAnnotationsOk() (*[]string, bool) { +func (o *FieldDiff) GetAnnotationsOk() ([]string, bool) { if o == nil || o.Annotations == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *FieldDiff) HasAnnotations() bool { // SetAnnotations gets a reference to the given []string and assigns it to the Annotations field. func (o *FieldDiff) SetAnnotations(v []string) { - o.Annotations = &v + o.Annotations = v } // GetName returns the Name field value if set, zero value otherwise. diff --git a/clients/go/v1/model_fuzzy_match.go b/clients/go/v1/model_fuzzy_match.go index 7257d3c2..93fa73b7 100644 --- a/clients/go/v1/model_fuzzy_match.go +++ b/clients/go/v1/model_fuzzy_match.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // FuzzyMatch struct for FuzzyMatch type FuzzyMatch struct { ID *string `json:"ID,omitempty"` - Scope *[]string `json:"Scope,omitempty"` + Scope []string `json:"Scope,omitempty"` } // NewFuzzyMatch instantiates a new FuzzyMatch object @@ -76,12 +76,12 @@ func (o *FuzzyMatch) GetScope() []string { var ret []string return ret } - return *o.Scope + return o.Scope } // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FuzzyMatch) GetScopeOk() (*[]string, bool) { +func (o *FuzzyMatch) GetScopeOk() ([]string, bool) { if o == nil || o.Scope == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *FuzzyMatch) HasScope() bool { // SetScope gets a reference to the given []string and assigns it to the Scope field. func (o *FuzzyMatch) SetScope(v []string) { - o.Scope = &v + o.Scope = v } func (o FuzzyMatch) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_fuzzy_search_request.go b/clients/go/v1/model_fuzzy_search_request.go index 549e5d70..ff3301c0 100644 --- a/clients/go/v1/model_fuzzy_search_request.go +++ b/clients/go/v1/model_fuzzy_search_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_fuzzy_search_response.go b/clients/go/v1/model_fuzzy_search_response.go index 432073f1..e74b29b2 100644 --- a/clients/go/v1/model_fuzzy_search_response.go +++ b/clients/go/v1/model_fuzzy_search_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_gauge_value.go b/clients/go/v1/model_gauge_value.go index 754f4483..44f04ff1 100644 --- a/clients/go/v1/model_gauge_value.go +++ b/clients/go/v1/model_gauge_value.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_host_network_info.go b/clients/go/v1/model_host_network_info.go index 3621300a..eadbf7be 100644 --- a/clients/go/v1/model_host_network_info.go +++ b/clients/go/v1/model_host_network_info.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_host_volume_info.go b/clients/go/v1/model_host_volume_info.go index f332e543..01b4beeb 100644 --- a/clients/go/v1/model_host_volume_info.go +++ b/clients/go/v1/model_host_volume_info.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job.go b/clients/go/v1/model_job.go index 16d2f40c..d7fb425f 100644 --- a/clients/go/v1/model_job.go +++ b/clients/go/v1/model_job.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,13 +17,13 @@ import ( // Job struct for Job type Job struct { - Affinities *[]Affinity `json:"Affinities,omitempty"` + Affinities []Affinity `json:"Affinities,omitempty"` AllAtOnce *bool `json:"AllAtOnce,omitempty"` - Constraints *[]Constraint `json:"Constraints,omitempty"` + Constraints []Constraint `json:"Constraints,omitempty"` ConsulNamespace *string `json:"ConsulNamespace,omitempty"` ConsulToken *string `json:"ConsulToken,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` - Datacenters *[]string `json:"Datacenters,omitempty"` + Datacenters []string `json:"Datacenters,omitempty"` DispatchIdempotencyToken *string `json:"DispatchIdempotencyToken,omitempty"` Dispatched *bool `json:"Dispatched,omitempty"` ID *string `json:"ID,omitempty"` @@ -31,24 +31,24 @@ type Job struct { Meta *map[string]string `json:"Meta,omitempty"` Migrate *MigrateStrategy `json:"Migrate,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` - Multiregion *Multiregion `json:"Multiregion,omitempty"` + Multiregion NullableMultiregion `json:"Multiregion,omitempty"` Name *string `json:"Name,omitempty"` Namespace *string `json:"Namespace,omitempty"` NomadTokenID *string `json:"NomadTokenID,omitempty"` - ParameterizedJob *ParameterizedJobConfig `json:"ParameterizedJob,omitempty"` + ParameterizedJob NullableParameterizedJobConfig `json:"ParameterizedJob,omitempty"` ParentID *string `json:"ParentID,omitempty"` Payload *string `json:"Payload,omitempty"` Periodic *PeriodicConfig `json:"Periodic,omitempty"` Priority *int32 `json:"Priority,omitempty"` Region *string `json:"Region,omitempty"` Reschedule *ReschedulePolicy `json:"Reschedule,omitempty"` - Spreads *[]Spread `json:"Spreads,omitempty"` + Spreads []Spread `json:"Spreads,omitempty"` Stable *bool `json:"Stable,omitempty"` Status *string `json:"Status,omitempty"` StatusDescription *string `json:"StatusDescription,omitempty"` Stop *bool `json:"Stop,omitempty"` SubmitTime *int64 `json:"SubmitTime,omitempty"` - TaskGroups *[]TaskGroup `json:"TaskGroups,omitempty"` + TaskGroups []TaskGroup `json:"TaskGroups,omitempty"` Type *string `json:"Type,omitempty"` Update *UpdateStrategy `json:"Update,omitempty"` VaultNamespace *string `json:"VaultNamespace,omitempty"` @@ -79,12 +79,12 @@ func (o *Job) GetAffinities() []Affinity { var ret []Affinity return ret } - return *o.Affinities + return o.Affinities } // GetAffinitiesOk returns a tuple with the Affinities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Job) GetAffinitiesOk() (*[]Affinity, bool) { +func (o *Job) GetAffinitiesOk() ([]Affinity, bool) { if o == nil || o.Affinities == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *Job) HasAffinities() bool { // SetAffinities gets a reference to the given []Affinity and assigns it to the Affinities field. func (o *Job) SetAffinities(v []Affinity) { - o.Affinities = &v + o.Affinities = v } // GetAllAtOnce returns the AllAtOnce field value if set, zero value otherwise. @@ -143,12 +143,12 @@ func (o *Job) GetConstraints() []Constraint { var ret []Constraint return ret } - return *o.Constraints + return o.Constraints } // GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Job) GetConstraintsOk() (*[]Constraint, bool) { +func (o *Job) GetConstraintsOk() ([]Constraint, bool) { if o == nil || o.Constraints == nil { return nil, false } @@ -166,7 +166,7 @@ func (o *Job) HasConstraints() bool { // SetConstraints gets a reference to the given []Constraint and assigns it to the Constraints field. func (o *Job) SetConstraints(v []Constraint) { - o.Constraints = &v + o.Constraints = v } // GetConsulNamespace returns the ConsulNamespace field value if set, zero value otherwise. @@ -271,12 +271,12 @@ func (o *Job) GetDatacenters() []string { var ret []string return ret } - return *o.Datacenters + return o.Datacenters } // GetDatacentersOk returns a tuple with the Datacenters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Job) GetDatacentersOk() (*[]string, bool) { +func (o *Job) GetDatacentersOk() ([]string, bool) { if o == nil || o.Datacenters == nil { return nil, false } @@ -294,7 +294,7 @@ func (o *Job) HasDatacenters() bool { // SetDatacenters gets a reference to the given []string and assigns it to the Datacenters field. func (o *Job) SetDatacenters(v []string) { - o.Datacenters = &v + o.Datacenters = v } // GetDispatchIdempotencyToken returns the DispatchIdempotencyToken field value if set, zero value otherwise. @@ -521,36 +521,46 @@ func (o *Job) SetModifyIndex(v int32) { o.ModifyIndex = &v } -// GetMultiregion returns the Multiregion field value if set, zero value otherwise. +// GetMultiregion returns the Multiregion field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Job) GetMultiregion() Multiregion { - if o == nil || o.Multiregion == nil { + if o == nil || o.Multiregion.Get() == nil { var ret Multiregion return ret } - return *o.Multiregion + return *o.Multiregion.Get() } // GetMultiregionOk returns a tuple with the Multiregion field value if set, nil otherwise // 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 *Job) GetMultiregionOk() (*Multiregion, bool) { - if o == nil || o.Multiregion == nil { + if o == nil { return nil, false } - return o.Multiregion, true + return o.Multiregion.Get(), o.Multiregion.IsSet() } // HasMultiregion returns a boolean if a field has been set. func (o *Job) HasMultiregion() bool { - if o != nil && o.Multiregion != nil { + if o != nil && o.Multiregion.IsSet() { return true } return false } -// SetMultiregion gets a reference to the given Multiregion and assigns it to the Multiregion field. +// SetMultiregion gets a reference to the given NullableMultiregion and assigns it to the Multiregion field. func (o *Job) SetMultiregion(v Multiregion) { - o.Multiregion = &v + o.Multiregion.Set(&v) +} +// SetMultiregionNil sets the value for Multiregion to be an explicit nil +func (o *Job) SetMultiregionNil() { + o.Multiregion.Set(nil) +} + +// UnsetMultiregion ensures that no value is present for Multiregion, not even an explicit nil +func (o *Job) UnsetMultiregion() { + o.Multiregion.Unset() } // GetName returns the Name field value if set, zero value otherwise. @@ -649,36 +659,46 @@ func (o *Job) SetNomadTokenID(v string) { o.NomadTokenID = &v } -// GetParameterizedJob returns the ParameterizedJob field value if set, zero value otherwise. +// GetParameterizedJob returns the ParameterizedJob field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Job) GetParameterizedJob() ParameterizedJobConfig { - if o == nil || o.ParameterizedJob == nil { + if o == nil || o.ParameterizedJob.Get() == nil { var ret ParameterizedJobConfig return ret } - return *o.ParameterizedJob + return *o.ParameterizedJob.Get() } // GetParameterizedJobOk returns a tuple with the ParameterizedJob field value if set, nil otherwise // 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 *Job) GetParameterizedJobOk() (*ParameterizedJobConfig, bool) { - if o == nil || o.ParameterizedJob == nil { + if o == nil { return nil, false } - return o.ParameterizedJob, true + return o.ParameterizedJob.Get(), o.ParameterizedJob.IsSet() } // HasParameterizedJob returns a boolean if a field has been set. func (o *Job) HasParameterizedJob() bool { - if o != nil && o.ParameterizedJob != nil { + if o != nil && o.ParameterizedJob.IsSet() { return true } return false } -// SetParameterizedJob gets a reference to the given ParameterizedJobConfig and assigns it to the ParameterizedJob field. +// SetParameterizedJob gets a reference to the given NullableParameterizedJobConfig and assigns it to the ParameterizedJob field. func (o *Job) SetParameterizedJob(v ParameterizedJobConfig) { - o.ParameterizedJob = &v + o.ParameterizedJob.Set(&v) +} +// SetParameterizedJobNil sets the value for ParameterizedJob to be an explicit nil +func (o *Job) SetParameterizedJobNil() { + o.ParameterizedJob.Set(nil) +} + +// UnsetParameterizedJob ensures that no value is present for ParameterizedJob, not even an explicit nil +func (o *Job) UnsetParameterizedJob() { + o.ParameterizedJob.Unset() } // GetParentID returns the ParentID field value if set, zero value otherwise. @@ -879,12 +899,12 @@ func (o *Job) GetSpreads() []Spread { var ret []Spread return ret } - return *o.Spreads + return o.Spreads } // GetSpreadsOk returns a tuple with the Spreads field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Job) GetSpreadsOk() (*[]Spread, bool) { +func (o *Job) GetSpreadsOk() ([]Spread, bool) { if o == nil || o.Spreads == nil { return nil, false } @@ -902,7 +922,7 @@ func (o *Job) HasSpreads() bool { // SetSpreads gets a reference to the given []Spread and assigns it to the Spreads field. func (o *Job) SetSpreads(v []Spread) { - o.Spreads = &v + o.Spreads = v } // GetStable returns the Stable field value if set, zero value otherwise. @@ -1071,12 +1091,12 @@ func (o *Job) GetTaskGroups() []TaskGroup { var ret []TaskGroup return ret } - return *o.TaskGroups + return o.TaskGroups } // GetTaskGroupsOk returns a tuple with the TaskGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Job) GetTaskGroupsOk() (*[]TaskGroup, bool) { +func (o *Job) GetTaskGroupsOk() ([]TaskGroup, bool) { if o == nil || o.TaskGroups == nil { return nil, false } @@ -1094,7 +1114,7 @@ func (o *Job) HasTaskGroups() bool { // SetTaskGroups gets a reference to the given []TaskGroup and assigns it to the TaskGroups field. func (o *Job) SetTaskGroups(v []TaskGroup) { - o.TaskGroups = &v + o.TaskGroups = v } // GetType returns the Type field value if set, zero value otherwise. @@ -1301,8 +1321,8 @@ func (o Job) MarshalJSON() ([]byte, error) { if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex } - if o.Multiregion != nil { - toSerialize["Multiregion"] = o.Multiregion + if o.Multiregion.IsSet() { + toSerialize["Multiregion"] = o.Multiregion.Get() } if o.Name != nil { toSerialize["Name"] = o.Name @@ -1313,8 +1333,8 @@ func (o Job) MarshalJSON() ([]byte, error) { if o.NomadTokenID != nil { toSerialize["NomadTokenID"] = o.NomadTokenID } - if o.ParameterizedJob != nil { - toSerialize["ParameterizedJob"] = o.ParameterizedJob + if o.ParameterizedJob.IsSet() { + toSerialize["ParameterizedJob"] = o.ParameterizedJob.Get() } if o.ParentID != nil { toSerialize["ParentID"] = o.ParentID diff --git a/clients/go/v1/model_job_children_summary.go b/clients/go/v1/model_job_children_summary.go index 837a7b80..7f3c229b 100644 --- a/clients/go/v1/model_job_children_summary.go +++ b/clients/go/v1/model_job_children_summary.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_deregister_response.go b/clients/go/v1/model_job_deregister_response.go index 0d3cb08a..527c704d 100644 --- a/clients/go/v1/model_job_deregister_response.go +++ b/clients/go/v1/model_job_deregister_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_diff.go b/clients/go/v1/model_job_diff.go index e290f8bd..d586eb1d 100644 --- a/clients/go/v1/model_job_diff.go +++ b/clients/go/v1/model_job_diff.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // JobDiff struct for JobDiff type JobDiff struct { - Fields *[]FieldDiff `json:"Fields,omitempty"` + Fields []FieldDiff `json:"Fields,omitempty"` ID *string `json:"ID,omitempty"` - Objects *[]ObjectDiff `json:"Objects,omitempty"` - TaskGroups *[]TaskGroupDiff `json:"TaskGroups,omitempty"` + Objects []ObjectDiff `json:"Objects,omitempty"` + TaskGroups []TaskGroupDiff `json:"TaskGroups,omitempty"` Type *string `json:"Type,omitempty"` } @@ -47,12 +47,12 @@ func (o *JobDiff) GetFields() []FieldDiff { var ret []FieldDiff return ret } - return *o.Fields + return o.Fields } // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobDiff) GetFieldsOk() (*[]FieldDiff, bool) { +func (o *JobDiff) GetFieldsOk() ([]FieldDiff, bool) { if o == nil || o.Fields == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *JobDiff) HasFields() bool { // SetFields gets a reference to the given []FieldDiff and assigns it to the Fields field. func (o *JobDiff) SetFields(v []FieldDiff) { - o.Fields = &v + o.Fields = v } // GetID returns the ID field value if set, zero value otherwise. @@ -111,12 +111,12 @@ func (o *JobDiff) GetObjects() []ObjectDiff { var ret []ObjectDiff return ret } - return *o.Objects + return o.Objects } // GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobDiff) GetObjectsOk() (*[]ObjectDiff, bool) { +func (o *JobDiff) GetObjectsOk() ([]ObjectDiff, bool) { if o == nil || o.Objects == nil { return nil, false } @@ -134,7 +134,7 @@ func (o *JobDiff) HasObjects() bool { // SetObjects gets a reference to the given []ObjectDiff and assigns it to the Objects field. func (o *JobDiff) SetObjects(v []ObjectDiff) { - o.Objects = &v + o.Objects = v } // GetTaskGroups returns the TaskGroups field value if set, zero value otherwise. @@ -143,12 +143,12 @@ func (o *JobDiff) GetTaskGroups() []TaskGroupDiff { var ret []TaskGroupDiff return ret } - return *o.TaskGroups + return o.TaskGroups } // GetTaskGroupsOk returns a tuple with the TaskGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobDiff) GetTaskGroupsOk() (*[]TaskGroupDiff, bool) { +func (o *JobDiff) GetTaskGroupsOk() ([]TaskGroupDiff, bool) { if o == nil || o.TaskGroups == nil { return nil, false } @@ -166,7 +166,7 @@ func (o *JobDiff) HasTaskGroups() bool { // SetTaskGroups gets a reference to the given []TaskGroupDiff and assigns it to the TaskGroups field. func (o *JobDiff) SetTaskGroups(v []TaskGroupDiff) { - o.TaskGroups = &v + o.TaskGroups = v } // GetType returns the Type field value if set, zero value otherwise. diff --git a/clients/go/v1/model_job_dispatch_request.go b/clients/go/v1/model_job_dispatch_request.go index be8efb5e..ec6f2e9f 100644 --- a/clients/go/v1/model_job_dispatch_request.go +++ b/clients/go/v1/model_job_dispatch_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_dispatch_response.go b/clients/go/v1/model_job_dispatch_response.go index 36015422..471c16da 100644 --- a/clients/go/v1/model_job_dispatch_response.go +++ b/clients/go/v1/model_job_dispatch_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_evaluate_request.go b/clients/go/v1/model_job_evaluate_request.go index 1f8d9424..340f5ea9 100644 --- a/clients/go/v1/model_job_evaluate_request.go +++ b/clients/go/v1/model_job_evaluate_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // JobEvaluateRequest struct for JobEvaluateRequest type JobEvaluateRequest struct { - EvalOptions *EvalOptions `json:"EvalOptions,omitempty"` + EvalOptions NullableEvalOptions `json:"EvalOptions,omitempty"` JobID *string `json:"JobID,omitempty"` Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` @@ -41,36 +41,46 @@ func NewJobEvaluateRequestWithDefaults() *JobEvaluateRequest { return &this } -// GetEvalOptions returns the EvalOptions field value if set, zero value otherwise. +// GetEvalOptions returns the EvalOptions field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobEvaluateRequest) GetEvalOptions() EvalOptions { - if o == nil || o.EvalOptions == nil { + if o == nil || o.EvalOptions.Get() == nil { var ret EvalOptions return ret } - return *o.EvalOptions + return *o.EvalOptions.Get() } // GetEvalOptionsOk returns a tuple with the EvalOptions field value if set, nil otherwise // 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 *JobEvaluateRequest) GetEvalOptionsOk() (*EvalOptions, bool) { - if o == nil || o.EvalOptions == nil { + if o == nil { return nil, false } - return o.EvalOptions, true + return o.EvalOptions.Get(), o.EvalOptions.IsSet() } // HasEvalOptions returns a boolean if a field has been set. func (o *JobEvaluateRequest) HasEvalOptions() bool { - if o != nil && o.EvalOptions != nil { + if o != nil && o.EvalOptions.IsSet() { return true } return false } -// SetEvalOptions gets a reference to the given EvalOptions and assigns it to the EvalOptions field. +// SetEvalOptions gets a reference to the given NullableEvalOptions and assigns it to the EvalOptions field. func (o *JobEvaluateRequest) SetEvalOptions(v EvalOptions) { - o.EvalOptions = &v + o.EvalOptions.Set(&v) +} +// SetEvalOptionsNil sets the value for EvalOptions to be an explicit nil +func (o *JobEvaluateRequest) SetEvalOptionsNil() { + o.EvalOptions.Set(nil) +} + +// UnsetEvalOptions ensures that no value is present for EvalOptions, not even an explicit nil +func (o *JobEvaluateRequest) UnsetEvalOptions() { + o.EvalOptions.Unset() } // GetJobID returns the JobID field value if set, zero value otherwise. @@ -203,8 +213,8 @@ func (o *JobEvaluateRequest) SetSecretID(v string) { func (o JobEvaluateRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.EvalOptions != nil { - toSerialize["EvalOptions"] = o.EvalOptions + if o.EvalOptions.IsSet() { + toSerialize["EvalOptions"] = o.EvalOptions.Get() } if o.JobID != nil { toSerialize["JobID"] = o.JobID diff --git a/clients/go/v1/model_job_list_stub.go b/clients/go/v1/model_job_list_stub.go index b513c7e9..c5fe9fd1 100644 --- a/clients/go/v1/model_job_list_stub.go +++ b/clients/go/v1/model_job_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,10 +18,10 @@ import ( // JobListStub struct for JobListStub type JobListStub struct { CreateIndex *int32 `json:"CreateIndex,omitempty"` - Datacenters *[]string `json:"Datacenters,omitempty"` + Datacenters []string `json:"Datacenters,omitempty"` ID *string `json:"ID,omitempty"` JobModifyIndex *int32 `json:"JobModifyIndex,omitempty"` - JobSummary *JobSummary `json:"JobSummary,omitempty"` + JobSummary NullableJobSummary `json:"JobSummary,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Name *string `json:"Name,omitempty"` Namespace *string `json:"Namespace,omitempty"` @@ -91,12 +91,12 @@ func (o *JobListStub) GetDatacenters() []string { var ret []string return ret } - return *o.Datacenters + return o.Datacenters } // GetDatacentersOk returns a tuple with the Datacenters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobListStub) GetDatacentersOk() (*[]string, bool) { +func (o *JobListStub) GetDatacentersOk() ([]string, bool) { if o == nil || o.Datacenters == nil { return nil, false } @@ -114,7 +114,7 @@ func (o *JobListStub) HasDatacenters() bool { // SetDatacenters gets a reference to the given []string and assigns it to the Datacenters field. func (o *JobListStub) SetDatacenters(v []string) { - o.Datacenters = &v + o.Datacenters = v } // GetID returns the ID field value if set, zero value otherwise. @@ -181,36 +181,46 @@ func (o *JobListStub) SetJobModifyIndex(v int32) { o.JobModifyIndex = &v } -// GetJobSummary returns the JobSummary field value if set, zero value otherwise. +// GetJobSummary returns the JobSummary field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobListStub) GetJobSummary() JobSummary { - if o == nil || o.JobSummary == nil { + if o == nil || o.JobSummary.Get() == nil { var ret JobSummary return ret } - return *o.JobSummary + return *o.JobSummary.Get() } // GetJobSummaryOk returns a tuple with the JobSummary field value if set, nil otherwise // 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 *JobListStub) GetJobSummaryOk() (*JobSummary, bool) { - if o == nil || o.JobSummary == nil { + if o == nil { return nil, false } - return o.JobSummary, true + return o.JobSummary.Get(), o.JobSummary.IsSet() } // HasJobSummary returns a boolean if a field has been set. func (o *JobListStub) HasJobSummary() bool { - if o != nil && o.JobSummary != nil { + if o != nil && o.JobSummary.IsSet() { return true } return false } -// SetJobSummary gets a reference to the given JobSummary and assigns it to the JobSummary field. +// SetJobSummary gets a reference to the given NullableJobSummary and assigns it to the JobSummary field. func (o *JobListStub) SetJobSummary(v JobSummary) { - o.JobSummary = &v + o.JobSummary.Set(&v) +} +// SetJobSummaryNil sets the value for JobSummary to be an explicit nil +func (o *JobListStub) SetJobSummaryNil() { + o.JobSummary.Set(nil) +} + +// UnsetJobSummary ensures that no value is present for JobSummary, not even an explicit nil +func (o *JobListStub) UnsetJobSummary() { + o.JobSummary.Unset() } // GetModifyIndex returns the ModifyIndex field value if set, zero value otherwise. @@ -611,8 +621,8 @@ func (o JobListStub) MarshalJSON() ([]byte, error) { if o.JobModifyIndex != nil { toSerialize["JobModifyIndex"] = o.JobModifyIndex } - if o.JobSummary != nil { - toSerialize["JobSummary"] = o.JobSummary + if o.JobSummary.IsSet() { + toSerialize["JobSummary"] = o.JobSummary.Get() } if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex diff --git a/clients/go/v1/model_job_plan_request.go b/clients/go/v1/model_job_plan_request.go index f8a89e83..16e096a7 100644 --- a/clients/go/v1/model_job_plan_request.go +++ b/clients/go/v1/model_job_plan_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // JobPlanRequest struct for JobPlanRequest type JobPlanRequest struct { Diff *bool `json:"Diff,omitempty"` - Job *Job `json:"Job,omitempty"` + Job NullableJob `json:"Job,omitempty"` Namespace *string `json:"Namespace,omitempty"` PolicyOverride *bool `json:"PolicyOverride,omitempty"` Region *string `json:"Region,omitempty"` @@ -74,36 +74,46 @@ func (o *JobPlanRequest) SetDiff(v bool) { o.Diff = &v } -// GetJob returns the Job field value if set, zero value otherwise. +// GetJob returns the Job field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobPlanRequest) GetJob() Job { - if o == nil || o.Job == nil { + if o == nil || o.Job.Get() == nil { var ret Job return ret } - return *o.Job + return *o.Job.Get() } // GetJobOk returns a tuple with the Job field value if set, nil otherwise // 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 *JobPlanRequest) GetJobOk() (*Job, bool) { - if o == nil || o.Job == nil { + if o == nil { return nil, false } - return o.Job, true + return o.Job.Get(), o.Job.IsSet() } // HasJob returns a boolean if a field has been set. func (o *JobPlanRequest) HasJob() bool { - if o != nil && o.Job != nil { + if o != nil && o.Job.IsSet() { return true } return false } -// SetJob gets a reference to the given Job and assigns it to the Job field. +// SetJob gets a reference to the given NullableJob and assigns it to the Job field. func (o *JobPlanRequest) SetJob(v Job) { - o.Job = &v + o.Job.Set(&v) +} +// SetJobNil sets the value for Job to be an explicit nil +func (o *JobPlanRequest) SetJobNil() { + o.Job.Set(nil) +} + +// UnsetJob ensures that no value is present for Job, not even an explicit nil +func (o *JobPlanRequest) UnsetJob() { + o.Job.Unset() } // GetNamespace returns the Namespace field value if set, zero value otherwise. @@ -239,8 +249,8 @@ func (o JobPlanRequest) MarshalJSON() ([]byte, error) { if o.Diff != nil { toSerialize["Diff"] = o.Diff } - if o.Job != nil { - toSerialize["Job"] = o.Job + if o.Job.IsSet() { + toSerialize["Job"] = o.Job.Get() } if o.Namespace != nil { toSerialize["Namespace"] = o.Namespace diff --git a/clients/go/v1/model_job_plan_response.go b/clients/go/v1/model_job_plan_response.go index 7a372d72..e77e2414 100644 --- a/clients/go/v1/model_job_plan_response.go +++ b/clients/go/v1/model_job_plan_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,12 +18,12 @@ import ( // JobPlanResponse struct for JobPlanResponse type JobPlanResponse struct { - Annotations *PlanAnnotations `json:"Annotations,omitempty"` - CreatedEvals *[]Evaluation `json:"CreatedEvals,omitempty"` - Diff *JobDiff `json:"Diff,omitempty"` + Annotations NullablePlanAnnotations `json:"Annotations,omitempty"` + CreatedEvals []Evaluation `json:"CreatedEvals,omitempty"` + Diff NullableJobDiff `json:"Diff,omitempty"` FailedTGAllocs *map[string]AllocationMetric `json:"FailedTGAllocs,omitempty"` JobModifyIndex *int32 `json:"JobModifyIndex,omitempty"` - NextPeriodicLaunch *time.Time `json:"NextPeriodicLaunch,omitempty"` + NextPeriodicLaunch NullableTime `json:"NextPeriodicLaunch,omitempty"` Warnings *string `json:"Warnings,omitempty"` } @@ -44,36 +44,46 @@ func NewJobPlanResponseWithDefaults() *JobPlanResponse { return &this } -// GetAnnotations returns the Annotations field value if set, zero value otherwise. +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobPlanResponse) GetAnnotations() PlanAnnotations { - if o == nil || o.Annotations == nil { + if o == nil || o.Annotations.Get() == nil { var ret PlanAnnotations return ret } - return *o.Annotations + return *o.Annotations.Get() } // GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise // 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 *JobPlanResponse) GetAnnotationsOk() (*PlanAnnotations, bool) { - if o == nil || o.Annotations == nil { + if o == nil { return nil, false } - return o.Annotations, true + return o.Annotations.Get(), o.Annotations.IsSet() } // HasAnnotations returns a boolean if a field has been set. func (o *JobPlanResponse) HasAnnotations() bool { - if o != nil && o.Annotations != nil { + if o != nil && o.Annotations.IsSet() { return true } return false } -// SetAnnotations gets a reference to the given PlanAnnotations and assigns it to the Annotations field. +// SetAnnotations gets a reference to the given NullablePlanAnnotations and assigns it to the Annotations field. func (o *JobPlanResponse) SetAnnotations(v PlanAnnotations) { - o.Annotations = &v + o.Annotations.Set(&v) +} +// SetAnnotationsNil sets the value for Annotations to be an explicit nil +func (o *JobPlanResponse) SetAnnotationsNil() { + o.Annotations.Set(nil) +} + +// UnsetAnnotations ensures that no value is present for Annotations, not even an explicit nil +func (o *JobPlanResponse) UnsetAnnotations() { + o.Annotations.Unset() } // GetCreatedEvals returns the CreatedEvals field value if set, zero value otherwise. @@ -82,12 +92,12 @@ func (o *JobPlanResponse) GetCreatedEvals() []Evaluation { var ret []Evaluation return ret } - return *o.CreatedEvals + return o.CreatedEvals } // GetCreatedEvalsOk returns a tuple with the CreatedEvals field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobPlanResponse) GetCreatedEvalsOk() (*[]Evaluation, bool) { +func (o *JobPlanResponse) GetCreatedEvalsOk() ([]Evaluation, bool) { if o == nil || o.CreatedEvals == nil { return nil, false } @@ -105,39 +115,49 @@ func (o *JobPlanResponse) HasCreatedEvals() bool { // SetCreatedEvals gets a reference to the given []Evaluation and assigns it to the CreatedEvals field. func (o *JobPlanResponse) SetCreatedEvals(v []Evaluation) { - o.CreatedEvals = &v + o.CreatedEvals = v } -// GetDiff returns the Diff field value if set, zero value otherwise. +// GetDiff returns the Diff field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobPlanResponse) GetDiff() JobDiff { - if o == nil || o.Diff == nil { + if o == nil || o.Diff.Get() == nil { var ret JobDiff return ret } - return *o.Diff + return *o.Diff.Get() } // GetDiffOk returns a tuple with the Diff field value if set, nil otherwise // 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 *JobPlanResponse) GetDiffOk() (*JobDiff, bool) { - if o == nil || o.Diff == nil { + if o == nil { return nil, false } - return o.Diff, true + return o.Diff.Get(), o.Diff.IsSet() } // HasDiff returns a boolean if a field has been set. func (o *JobPlanResponse) HasDiff() bool { - if o != nil && o.Diff != nil { + if o != nil && o.Diff.IsSet() { return true } return false } -// SetDiff gets a reference to the given JobDiff and assigns it to the Diff field. +// SetDiff gets a reference to the given NullableJobDiff and assigns it to the Diff field. func (o *JobPlanResponse) SetDiff(v JobDiff) { - o.Diff = &v + o.Diff.Set(&v) +} +// SetDiffNil sets the value for Diff to be an explicit nil +func (o *JobPlanResponse) SetDiffNil() { + o.Diff.Set(nil) +} + +// UnsetDiff ensures that no value is present for Diff, not even an explicit nil +func (o *JobPlanResponse) UnsetDiff() { + o.Diff.Unset() } // GetFailedTGAllocs returns the FailedTGAllocs field value if set, zero value otherwise. @@ -204,36 +224,46 @@ func (o *JobPlanResponse) SetJobModifyIndex(v int32) { o.JobModifyIndex = &v } -// GetNextPeriodicLaunch returns the NextPeriodicLaunch field value if set, zero value otherwise. +// GetNextPeriodicLaunch returns the NextPeriodicLaunch field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobPlanResponse) GetNextPeriodicLaunch() time.Time { - if o == nil || o.NextPeriodicLaunch == nil { + if o == nil || o.NextPeriodicLaunch.Get() == nil { var ret time.Time return ret } - return *o.NextPeriodicLaunch + return *o.NextPeriodicLaunch.Get() } // GetNextPeriodicLaunchOk returns a tuple with the NextPeriodicLaunch field value if set, nil otherwise // 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 *JobPlanResponse) GetNextPeriodicLaunchOk() (*time.Time, bool) { - if o == nil || o.NextPeriodicLaunch == nil { + if o == nil { return nil, false } - return o.NextPeriodicLaunch, true + return o.NextPeriodicLaunch.Get(), o.NextPeriodicLaunch.IsSet() } // HasNextPeriodicLaunch returns a boolean if a field has been set. func (o *JobPlanResponse) HasNextPeriodicLaunch() bool { - if o != nil && o.NextPeriodicLaunch != nil { + if o != nil && o.NextPeriodicLaunch.IsSet() { return true } return false } -// SetNextPeriodicLaunch gets a reference to the given time.Time and assigns it to the NextPeriodicLaunch field. +// SetNextPeriodicLaunch gets a reference to the given NullableTime and assigns it to the NextPeriodicLaunch field. func (o *JobPlanResponse) SetNextPeriodicLaunch(v time.Time) { - o.NextPeriodicLaunch = &v + o.NextPeriodicLaunch.Set(&v) +} +// SetNextPeriodicLaunchNil sets the value for NextPeriodicLaunch to be an explicit nil +func (o *JobPlanResponse) SetNextPeriodicLaunchNil() { + o.NextPeriodicLaunch.Set(nil) +} + +// UnsetNextPeriodicLaunch ensures that no value is present for NextPeriodicLaunch, not even an explicit nil +func (o *JobPlanResponse) UnsetNextPeriodicLaunch() { + o.NextPeriodicLaunch.Unset() } // GetWarnings returns the Warnings field value if set, zero value otherwise. @@ -270,14 +300,14 @@ func (o *JobPlanResponse) SetWarnings(v string) { func (o JobPlanResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Annotations != nil { - toSerialize["Annotations"] = o.Annotations + if o.Annotations.IsSet() { + toSerialize["Annotations"] = o.Annotations.Get() } if o.CreatedEvals != nil { toSerialize["CreatedEvals"] = o.CreatedEvals } - if o.Diff != nil { - toSerialize["Diff"] = o.Diff + if o.Diff.IsSet() { + toSerialize["Diff"] = o.Diff.Get() } if o.FailedTGAllocs != nil { toSerialize["FailedTGAllocs"] = o.FailedTGAllocs @@ -285,8 +315,8 @@ func (o JobPlanResponse) MarshalJSON() ([]byte, error) { if o.JobModifyIndex != nil { toSerialize["JobModifyIndex"] = o.JobModifyIndex } - if o.NextPeriodicLaunch != nil { - toSerialize["NextPeriodicLaunch"] = o.NextPeriodicLaunch + if o.NextPeriodicLaunch.IsSet() { + toSerialize["NextPeriodicLaunch"] = o.NextPeriodicLaunch.Get() } if o.Warnings != nil { toSerialize["Warnings"] = o.Warnings diff --git a/clients/go/v1/model_job_register_request.go b/clients/go/v1/model_job_register_request.go index 795859e3..7f59202e 100644 --- a/clients/go/v1/model_job_register_request.go +++ b/clients/go/v1/model_job_register_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type JobRegisterRequest struct { EnforceIndex *bool `json:"EnforceIndex,omitempty"` EvalPriority *int32 `json:"EvalPriority,omitempty"` - Job *Job `json:"Job,omitempty"` + Job NullableJob `json:"Job,omitempty"` JobModifyIndex *int32 `json:"JobModifyIndex,omitempty"` Namespace *string `json:"Namespace,omitempty"` PolicyOverride *bool `json:"PolicyOverride,omitempty"` @@ -109,36 +109,46 @@ func (o *JobRegisterRequest) SetEvalPriority(v int32) { o.EvalPriority = &v } -// GetJob returns the Job field value if set, zero value otherwise. +// GetJob returns the Job field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobRegisterRequest) GetJob() Job { - if o == nil || o.Job == nil { + if o == nil || o.Job.Get() == nil { var ret Job return ret } - return *o.Job + return *o.Job.Get() } // GetJobOk returns a tuple with the Job field value if set, nil otherwise // 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 *JobRegisterRequest) GetJobOk() (*Job, bool) { - if o == nil || o.Job == nil { + if o == nil { return nil, false } - return o.Job, true + return o.Job.Get(), o.Job.IsSet() } // HasJob returns a boolean if a field has been set. func (o *JobRegisterRequest) HasJob() bool { - if o != nil && o.Job != nil { + if o != nil && o.Job.IsSet() { return true } return false } -// SetJob gets a reference to the given Job and assigns it to the Job field. +// SetJob gets a reference to the given NullableJob and assigns it to the Job field. func (o *JobRegisterRequest) SetJob(v Job) { - o.Job = &v + o.Job.Set(&v) +} +// SetJobNil sets the value for Job to be an explicit nil +func (o *JobRegisterRequest) SetJobNil() { + o.Job.Set(nil) +} + +// UnsetJob ensures that no value is present for Job, not even an explicit nil +func (o *JobRegisterRequest) UnsetJob() { + o.Job.Unset() } // GetJobModifyIndex returns the JobModifyIndex field value if set, zero value otherwise. @@ -341,8 +351,8 @@ func (o JobRegisterRequest) MarshalJSON() ([]byte, error) { if o.EvalPriority != nil { toSerialize["EvalPriority"] = o.EvalPriority } - if o.Job != nil { - toSerialize["Job"] = o.Job + if o.Job.IsSet() { + toSerialize["Job"] = o.Job.Get() } if o.JobModifyIndex != nil { toSerialize["JobModifyIndex"] = o.JobModifyIndex diff --git a/clients/go/v1/model_job_register_response.go b/clients/go/v1/model_job_register_response.go index ee1c079d..41d16853 100644 --- a/clients/go/v1/model_job_register_response.go +++ b/clients/go/v1/model_job_register_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_revert_request.go b/clients/go/v1/model_job_revert_request.go index 0cc5921a..20fae70c 100644 --- a/clients/go/v1/model_job_revert_request.go +++ b/clients/go/v1/model_job_revert_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_scale_status_response.go b/clients/go/v1/model_job_scale_status_response.go index 160315fe..08aaef4f 100644 --- a/clients/go/v1/model_job_scale_status_response.go +++ b/clients/go/v1/model_job_scale_status_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_stability_request.go b/clients/go/v1/model_job_stability_request.go index 661684d5..93527a1b 100644 --- a/clients/go/v1/model_job_stability_request.go +++ b/clients/go/v1/model_job_stability_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_stability_response.go b/clients/go/v1/model_job_stability_response.go index 3471a6c9..32b9e609 100644 --- a/clients/go/v1/model_job_stability_response.go +++ b/clients/go/v1/model_job_stability_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_job_summary.go b/clients/go/v1/model_job_summary.go index c2359d2a..db8398d1 100644 --- a/clients/go/v1/model_job_summary.go +++ b/clients/go/v1/model_job_summary.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // JobSummary struct for JobSummary type JobSummary struct { - Children *JobChildrenSummary `json:"Children,omitempty"` + Children NullableJobChildrenSummary `json:"Children,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` JobID *string `json:"JobID,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` @@ -42,36 +42,46 @@ func NewJobSummaryWithDefaults() *JobSummary { return &this } -// GetChildren returns the Children field value if set, zero value otherwise. +// GetChildren returns the Children field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobSummary) GetChildren() JobChildrenSummary { - if o == nil || o.Children == nil { + if o == nil || o.Children.Get() == nil { var ret JobChildrenSummary return ret } - return *o.Children + return *o.Children.Get() } // GetChildrenOk returns a tuple with the Children field value if set, nil otherwise // 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 *JobSummary) GetChildrenOk() (*JobChildrenSummary, bool) { - if o == nil || o.Children == nil { + if o == nil { return nil, false } - return o.Children, true + return o.Children.Get(), o.Children.IsSet() } // HasChildren returns a boolean if a field has been set. func (o *JobSummary) HasChildren() bool { - if o != nil && o.Children != nil { + if o != nil && o.Children.IsSet() { return true } return false } -// SetChildren gets a reference to the given JobChildrenSummary and assigns it to the Children field. +// SetChildren gets a reference to the given NullableJobChildrenSummary and assigns it to the Children field. func (o *JobSummary) SetChildren(v JobChildrenSummary) { - o.Children = &v + o.Children.Set(&v) +} +// SetChildrenNil sets the value for Children to be an explicit nil +func (o *JobSummary) SetChildrenNil() { + o.Children.Set(nil) +} + +// UnsetChildren ensures that no value is present for Children, not even an explicit nil +func (o *JobSummary) UnsetChildren() { + o.Children.Unset() } // GetCreateIndex returns the CreateIndex field value if set, zero value otherwise. @@ -236,8 +246,8 @@ func (o *JobSummary) SetSummary(v map[string]TaskGroupSummary) { func (o JobSummary) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Children != nil { - toSerialize["Children"] = o.Children + if o.Children.IsSet() { + toSerialize["Children"] = o.Children.Get() } if o.CreateIndex != nil { toSerialize["CreateIndex"] = o.CreateIndex diff --git a/clients/go/v1/model_job_validate_request.go b/clients/go/v1/model_job_validate_request.go index 68272972..c28ace84 100644 --- a/clients/go/v1/model_job_validate_request.go +++ b/clients/go/v1/model_job_validate_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // JobValidateRequest struct for JobValidateRequest type JobValidateRequest struct { - Job *Job `json:"Job,omitempty"` + Job NullableJob `json:"Job,omitempty"` Namespace *string `json:"Namespace,omitempty"` Region *string `json:"Region,omitempty"` SecretID *string `json:"SecretID,omitempty"` @@ -40,36 +40,46 @@ func NewJobValidateRequestWithDefaults() *JobValidateRequest { return &this } -// GetJob returns the Job field value if set, zero value otherwise. +// GetJob returns the Job field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JobValidateRequest) GetJob() Job { - if o == nil || o.Job == nil { + if o == nil || o.Job.Get() == nil { var ret Job return ret } - return *o.Job + return *o.Job.Get() } // GetJobOk returns a tuple with the Job field value if set, nil otherwise // 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 *JobValidateRequest) GetJobOk() (*Job, bool) { - if o == nil || o.Job == nil { + if o == nil { return nil, false } - return o.Job, true + return o.Job.Get(), o.Job.IsSet() } // HasJob returns a boolean if a field has been set. func (o *JobValidateRequest) HasJob() bool { - if o != nil && o.Job != nil { + if o != nil && o.Job.IsSet() { return true } return false } -// SetJob gets a reference to the given Job and assigns it to the Job field. +// SetJob gets a reference to the given NullableJob and assigns it to the Job field. func (o *JobValidateRequest) SetJob(v Job) { - o.Job = &v + o.Job.Set(&v) +} +// SetJobNil sets the value for Job to be an explicit nil +func (o *JobValidateRequest) SetJobNil() { + o.Job.Set(nil) +} + +// UnsetJob ensures that no value is present for Job, not even an explicit nil +func (o *JobValidateRequest) UnsetJob() { + o.Job.Unset() } // GetNamespace returns the Namespace field value if set, zero value otherwise. @@ -170,8 +180,8 @@ func (o *JobValidateRequest) SetSecretID(v string) { func (o JobValidateRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Job != nil { - toSerialize["Job"] = o.Job + if o.Job.IsSet() { + toSerialize["Job"] = o.Job.Get() } if o.Namespace != nil { toSerialize["Namespace"] = o.Namespace diff --git a/clients/go/v1/model_job_validate_response.go b/clients/go/v1/model_job_validate_response.go index 2fe330b0..1ac76d9e 100644 --- a/clients/go/v1/model_job_validate_response.go +++ b/clients/go/v1/model_job_validate_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type JobValidateResponse struct { DriverConfigValidated *bool `json:"DriverConfigValidated,omitempty"` Error *string `json:"Error,omitempty"` - ValidationErrors *[]string `json:"ValidationErrors,omitempty"` + ValidationErrors []string `json:"ValidationErrors,omitempty"` Warnings *string `json:"Warnings,omitempty"` } @@ -110,12 +110,12 @@ func (o *JobValidateResponse) GetValidationErrors() []string { var ret []string return ret } - return *o.ValidationErrors + return o.ValidationErrors } // GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobValidateResponse) GetValidationErrorsOk() (*[]string, bool) { +func (o *JobValidateResponse) GetValidationErrorsOk() ([]string, bool) { if o == nil || o.ValidationErrors == nil { return nil, false } @@ -133,7 +133,7 @@ func (o *JobValidateResponse) HasValidationErrors() bool { // SetValidationErrors gets a reference to the given []string and assigns it to the ValidationErrors field. func (o *JobValidateResponse) SetValidationErrors(v []string) { - o.ValidationErrors = &v + o.ValidationErrors = v } // GetWarnings returns the Warnings field value if set, zero value otherwise. diff --git a/clients/go/v1/model_job_versions_response.go b/clients/go/v1/model_job_versions_response.go index f3d2fb98..b8591e0b 100644 --- a/clients/go/v1/model_job_versions_response.go +++ b/clients/go/v1/model_job_versions_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,13 +17,13 @@ import ( // JobVersionsResponse struct for JobVersionsResponse type JobVersionsResponse struct { - Diffs *[]JobDiff `json:"Diffs,omitempty"` + Diffs []JobDiff `json:"Diffs,omitempty"` KnownLeader *bool `json:"KnownLeader,omitempty"` LastContact *int64 `json:"LastContact,omitempty"` LastIndex *int32 `json:"LastIndex,omitempty"` NextToken *string `json:"NextToken,omitempty"` RequestTime *int64 `json:"RequestTime,omitempty"` - Versions *[]Job `json:"Versions,omitempty"` + Versions []Job `json:"Versions,omitempty"` } // NewJobVersionsResponse instantiates a new JobVersionsResponse object @@ -49,12 +49,12 @@ func (o *JobVersionsResponse) GetDiffs() []JobDiff { var ret []JobDiff return ret } - return *o.Diffs + return o.Diffs } // GetDiffsOk returns a tuple with the Diffs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobVersionsResponse) GetDiffsOk() (*[]JobDiff, bool) { +func (o *JobVersionsResponse) GetDiffsOk() ([]JobDiff, bool) { if o == nil || o.Diffs == nil { return nil, false } @@ -72,7 +72,7 @@ func (o *JobVersionsResponse) HasDiffs() bool { // SetDiffs gets a reference to the given []JobDiff and assigns it to the Diffs field. func (o *JobVersionsResponse) SetDiffs(v []JobDiff) { - o.Diffs = &v + o.Diffs = v } // GetKnownLeader returns the KnownLeader field value if set, zero value otherwise. @@ -241,12 +241,12 @@ func (o *JobVersionsResponse) GetVersions() []Job { var ret []Job return ret } - return *o.Versions + return o.Versions } // GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JobVersionsResponse) GetVersionsOk() (*[]Job, bool) { +func (o *JobVersionsResponse) GetVersionsOk() ([]Job, bool) { if o == nil || o.Versions == nil { return nil, false } @@ -264,7 +264,7 @@ func (o *JobVersionsResponse) HasVersions() bool { // SetVersions gets a reference to the given []Job and assigns it to the Versions field. func (o *JobVersionsResponse) SetVersions(v []Job) { - o.Versions = &v + o.Versions = v } func (o JobVersionsResponse) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_jobs_parse_request.go b/clients/go/v1/model_jobs_parse_request.go index e38637bf..4b305f57 100644 --- a/clients/go/v1/model_jobs_parse_request.go +++ b/clients/go/v1/model_jobs_parse_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_log_config.go b/clients/go/v1/model_log_config.go index 66dc3868..222ceab4 100644 --- a/clients/go/v1/model_log_config.go +++ b/clients/go/v1/model_log_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_metrics_summary.go b/clients/go/v1/model_metrics_summary.go index dea99a38..26536bdf 100644 --- a/clients/go/v1/model_metrics_summary.go +++ b/clients/go/v1/model_metrics_summary.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // MetricsSummary struct for MetricsSummary type MetricsSummary struct { - Counters *[]SampledValue `json:"Counters,omitempty"` - Gauges *[]GaugeValue `json:"Gauges,omitempty"` - Points *[]PointValue `json:"Points,omitempty"` - Samples *[]SampledValue `json:"Samples,omitempty"` + Counters []SampledValue `json:"Counters,omitempty"` + Gauges []GaugeValue `json:"Gauges,omitempty"` + Points []PointValue `json:"Points,omitempty"` + Samples []SampledValue `json:"Samples,omitempty"` Timestamp *string `json:"Timestamp,omitempty"` } @@ -47,12 +47,12 @@ func (o *MetricsSummary) GetCounters() []SampledValue { var ret []SampledValue return ret } - return *o.Counters + return o.Counters } // GetCountersOk returns a tuple with the Counters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MetricsSummary) GetCountersOk() (*[]SampledValue, bool) { +func (o *MetricsSummary) GetCountersOk() ([]SampledValue, bool) { if o == nil || o.Counters == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *MetricsSummary) HasCounters() bool { // SetCounters gets a reference to the given []SampledValue and assigns it to the Counters field. func (o *MetricsSummary) SetCounters(v []SampledValue) { - o.Counters = &v + o.Counters = v } // GetGauges returns the Gauges field value if set, zero value otherwise. @@ -79,12 +79,12 @@ func (o *MetricsSummary) GetGauges() []GaugeValue { var ret []GaugeValue return ret } - return *o.Gauges + return o.Gauges } // GetGaugesOk returns a tuple with the Gauges field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MetricsSummary) GetGaugesOk() (*[]GaugeValue, bool) { +func (o *MetricsSummary) GetGaugesOk() ([]GaugeValue, bool) { if o == nil || o.Gauges == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *MetricsSummary) HasGauges() bool { // SetGauges gets a reference to the given []GaugeValue and assigns it to the Gauges field. func (o *MetricsSummary) SetGauges(v []GaugeValue) { - o.Gauges = &v + o.Gauges = v } // GetPoints returns the Points field value if set, zero value otherwise. @@ -111,12 +111,12 @@ func (o *MetricsSummary) GetPoints() []PointValue { var ret []PointValue return ret } - return *o.Points + return o.Points } // GetPointsOk returns a tuple with the Points field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MetricsSummary) GetPointsOk() (*[]PointValue, bool) { +func (o *MetricsSummary) GetPointsOk() ([]PointValue, bool) { if o == nil || o.Points == nil { return nil, false } @@ -134,7 +134,7 @@ func (o *MetricsSummary) HasPoints() bool { // SetPoints gets a reference to the given []PointValue and assigns it to the Points field. func (o *MetricsSummary) SetPoints(v []PointValue) { - o.Points = &v + o.Points = v } // GetSamples returns the Samples field value if set, zero value otherwise. @@ -143,12 +143,12 @@ func (o *MetricsSummary) GetSamples() []SampledValue { var ret []SampledValue return ret } - return *o.Samples + return o.Samples } // GetSamplesOk returns a tuple with the Samples field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MetricsSummary) GetSamplesOk() (*[]SampledValue, bool) { +func (o *MetricsSummary) GetSamplesOk() ([]SampledValue, bool) { if o == nil || o.Samples == nil { return nil, false } @@ -166,7 +166,7 @@ func (o *MetricsSummary) HasSamples() bool { // SetSamples gets a reference to the given []SampledValue and assigns it to the Samples field. func (o *MetricsSummary) SetSamples(v []SampledValue) { - o.Samples = &v + o.Samples = v } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. diff --git a/clients/go/v1/model_migrate_strategy.go b/clients/go/v1/model_migrate_strategy.go index 8cc2272d..2ddc5bf2 100644 --- a/clients/go/v1/model_migrate_strategy.go +++ b/clients/go/v1/model_migrate_strategy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_multiregion.go b/clients/go/v1/model_multiregion.go index edf9a2fe..1d1b5972 100644 --- a/clients/go/v1/model_multiregion.go +++ b/clients/go/v1/model_multiregion.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // Multiregion struct for Multiregion type Multiregion struct { - Regions *[]MultiregionRegion `json:"Regions,omitempty"` + Regions []MultiregionRegion `json:"Regions,omitempty"` Strategy *MultiregionStrategy `json:"Strategy,omitempty"` } @@ -44,12 +44,12 @@ func (o *Multiregion) GetRegions() []MultiregionRegion { var ret []MultiregionRegion return ret } - return *o.Regions + return o.Regions } // GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Multiregion) GetRegionsOk() (*[]MultiregionRegion, bool) { +func (o *Multiregion) GetRegionsOk() ([]MultiregionRegion, bool) { if o == nil || o.Regions == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *Multiregion) HasRegions() bool { // SetRegions gets a reference to the given []MultiregionRegion and assigns it to the Regions field. func (o *Multiregion) SetRegions(v []MultiregionRegion) { - o.Regions = &v + o.Regions = v } // GetStrategy returns the Strategy field value if set, zero value otherwise. diff --git a/clients/go/v1/model_multiregion_region.go b/clients/go/v1/model_multiregion_region.go index 76608016..231c5fe4 100644 --- a/clients/go/v1/model_multiregion_region.go +++ b/clients/go/v1/model_multiregion_region.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // MultiregionRegion struct for MultiregionRegion type MultiregionRegion struct { Count *int32 `json:"Count,omitempty"` - Datacenters *[]string `json:"Datacenters,omitempty"` + Datacenters []string `json:"Datacenters,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` Name *string `json:"Name,omitempty"` } @@ -78,12 +78,12 @@ func (o *MultiregionRegion) GetDatacenters() []string { var ret []string return ret } - return *o.Datacenters + return o.Datacenters } // GetDatacentersOk returns a tuple with the Datacenters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MultiregionRegion) GetDatacentersOk() (*[]string, bool) { +func (o *MultiregionRegion) GetDatacentersOk() ([]string, bool) { if o == nil || o.Datacenters == nil { return nil, false } @@ -101,7 +101,7 @@ func (o *MultiregionRegion) HasDatacenters() bool { // SetDatacenters gets a reference to the given []string and assigns it to the Datacenters field. func (o *MultiregionRegion) SetDatacenters(v []string) { - o.Datacenters = &v + o.Datacenters = v } // GetMeta returns the Meta field value if set, zero value otherwise. diff --git a/clients/go/v1/model_multiregion_strategy.go b/clients/go/v1/model_multiregion_strategy.go index e77c552c..f6b499ee 100644 --- a/clients/go/v1/model_multiregion_strategy.go +++ b/clients/go/v1/model_multiregion_strategy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_namespace.go b/clients/go/v1/model_namespace.go index d15a9c14..90a7833c 100644 --- a/clients/go/v1/model_namespace.go +++ b/clients/go/v1/model_namespace.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // Namespace struct for Namespace type Namespace struct { - Capabilities *NamespaceCapabilities `json:"Capabilities,omitempty"` + Capabilities NullableNamespaceCapabilities `json:"Capabilities,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` Description *string `json:"Description,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` @@ -43,36 +43,46 @@ func NewNamespaceWithDefaults() *Namespace { return &this } -// GetCapabilities returns the Capabilities field value if set, zero value otherwise. +// GetCapabilities returns the Capabilities field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Namespace) GetCapabilities() NamespaceCapabilities { - if o == nil || o.Capabilities == nil { + if o == nil || o.Capabilities.Get() == nil { var ret NamespaceCapabilities return ret } - return *o.Capabilities + return *o.Capabilities.Get() } // GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise // 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 *Namespace) GetCapabilitiesOk() (*NamespaceCapabilities, bool) { - if o == nil || o.Capabilities == nil { + if o == nil { return nil, false } - return o.Capabilities, true + return o.Capabilities.Get(), o.Capabilities.IsSet() } // HasCapabilities returns a boolean if a field has been set. func (o *Namespace) HasCapabilities() bool { - if o != nil && o.Capabilities != nil { + if o != nil && o.Capabilities.IsSet() { return true } return false } -// SetCapabilities gets a reference to the given NamespaceCapabilities and assigns it to the Capabilities field. +// SetCapabilities gets a reference to the given NullableNamespaceCapabilities and assigns it to the Capabilities field. func (o *Namespace) SetCapabilities(v NamespaceCapabilities) { - o.Capabilities = &v + o.Capabilities.Set(&v) +} +// SetCapabilitiesNil sets the value for Capabilities to be an explicit nil +func (o *Namespace) SetCapabilitiesNil() { + o.Capabilities.Set(nil) +} + +// UnsetCapabilities ensures that no value is present for Capabilities, not even an explicit nil +func (o *Namespace) UnsetCapabilities() { + o.Capabilities.Unset() } // GetCreateIndex returns the CreateIndex field value if set, zero value otherwise. @@ -269,8 +279,8 @@ func (o *Namespace) SetQuota(v string) { func (o Namespace) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Capabilities != nil { - toSerialize["Capabilities"] = o.Capabilities + if o.Capabilities.IsSet() { + toSerialize["Capabilities"] = o.Capabilities.Get() } if o.CreateIndex != nil { toSerialize["CreateIndex"] = o.CreateIndex diff --git a/clients/go/v1/model_namespace_capabilities.go b/clients/go/v1/model_namespace_capabilities.go index baea414e..1b447264 100644 --- a/clients/go/v1/model_namespace_capabilities.go +++ b/clients/go/v1/model_namespace_capabilities.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,8 +17,8 @@ import ( // NamespaceCapabilities struct for NamespaceCapabilities type NamespaceCapabilities struct { - DisabledTaskDrivers *[]string `json:"DisabledTaskDrivers,omitempty"` - EnabledTaskDrivers *[]string `json:"EnabledTaskDrivers,omitempty"` + DisabledTaskDrivers []string `json:"DisabledTaskDrivers,omitempty"` + EnabledTaskDrivers []string `json:"EnabledTaskDrivers,omitempty"` } // NewNamespaceCapabilities instantiates a new NamespaceCapabilities object @@ -44,12 +44,12 @@ func (o *NamespaceCapabilities) GetDisabledTaskDrivers() []string { var ret []string return ret } - return *o.DisabledTaskDrivers + return o.DisabledTaskDrivers } // GetDisabledTaskDriversOk returns a tuple with the DisabledTaskDrivers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NamespaceCapabilities) GetDisabledTaskDriversOk() (*[]string, bool) { +func (o *NamespaceCapabilities) GetDisabledTaskDriversOk() ([]string, bool) { if o == nil || o.DisabledTaskDrivers == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *NamespaceCapabilities) HasDisabledTaskDrivers() bool { // SetDisabledTaskDrivers gets a reference to the given []string and assigns it to the DisabledTaskDrivers field. func (o *NamespaceCapabilities) SetDisabledTaskDrivers(v []string) { - o.DisabledTaskDrivers = &v + o.DisabledTaskDrivers = v } // GetEnabledTaskDrivers returns the EnabledTaskDrivers field value if set, zero value otherwise. @@ -76,12 +76,12 @@ func (o *NamespaceCapabilities) GetEnabledTaskDrivers() []string { var ret []string return ret } - return *o.EnabledTaskDrivers + return o.EnabledTaskDrivers } // GetEnabledTaskDriversOk returns a tuple with the EnabledTaskDrivers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NamespaceCapabilities) GetEnabledTaskDriversOk() (*[]string, bool) { +func (o *NamespaceCapabilities) GetEnabledTaskDriversOk() ([]string, bool) { if o == nil || o.EnabledTaskDrivers == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *NamespaceCapabilities) HasEnabledTaskDrivers() bool { // SetEnabledTaskDrivers gets a reference to the given []string and assigns it to the EnabledTaskDrivers field. func (o *NamespaceCapabilities) SetEnabledTaskDrivers(v []string) { - o.EnabledTaskDrivers = &v + o.EnabledTaskDrivers = v } func (o NamespaceCapabilities) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_network_resource.go b/clients/go/v1/model_network_resource.go index c29f544d..e4a3e18b 100644 --- a/clients/go/v1/model_network_resource.go +++ b/clients/go/v1/model_network_resource.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,14 +18,14 @@ import ( // NetworkResource struct for NetworkResource type NetworkResource struct { CIDR *string `json:"CIDR,omitempty"` - DNS *DNSConfig `json:"DNS,omitempty"` + DNS NullableDNSConfig `json:"DNS,omitempty"` Device *string `json:"Device,omitempty"` - DynamicPorts *[]Port `json:"DynamicPorts,omitempty"` + DynamicPorts []Port `json:"DynamicPorts,omitempty"` Hostname *string `json:"Hostname,omitempty"` IP *string `json:"IP,omitempty"` MBits *int32 `json:"MBits,omitempty"` Mode *string `json:"Mode,omitempty"` - ReservedPorts *[]Port `json:"ReservedPorts,omitempty"` + ReservedPorts []Port `json:"ReservedPorts,omitempty"` } // NewNetworkResource instantiates a new NetworkResource object @@ -77,36 +77,46 @@ func (o *NetworkResource) SetCIDR(v string) { o.CIDR = &v } -// GetDNS returns the DNS field value if set, zero value otherwise. +// GetDNS returns the DNS field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NetworkResource) GetDNS() DNSConfig { - if o == nil || o.DNS == nil { + if o == nil || o.DNS.Get() == nil { var ret DNSConfig return ret } - return *o.DNS + return *o.DNS.Get() } // GetDNSOk returns a tuple with the DNS field value if set, nil otherwise // 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 *NetworkResource) GetDNSOk() (*DNSConfig, bool) { - if o == nil || o.DNS == nil { + if o == nil { return nil, false } - return o.DNS, true + return o.DNS.Get(), o.DNS.IsSet() } // HasDNS returns a boolean if a field has been set. func (o *NetworkResource) HasDNS() bool { - if o != nil && o.DNS != nil { + if o != nil && o.DNS.IsSet() { return true } return false } -// SetDNS gets a reference to the given DNSConfig and assigns it to the DNS field. +// SetDNS gets a reference to the given NullableDNSConfig and assigns it to the DNS field. func (o *NetworkResource) SetDNS(v DNSConfig) { - o.DNS = &v + o.DNS.Set(&v) +} +// SetDNSNil sets the value for DNS to be an explicit nil +func (o *NetworkResource) SetDNSNil() { + o.DNS.Set(nil) +} + +// UnsetDNS ensures that no value is present for DNS, not even an explicit nil +func (o *NetworkResource) UnsetDNS() { + o.DNS.Unset() } // GetDevice returns the Device field value if set, zero value otherwise. @@ -147,12 +157,12 @@ func (o *NetworkResource) GetDynamicPorts() []Port { var ret []Port return ret } - return *o.DynamicPorts + return o.DynamicPorts } // GetDynamicPortsOk returns a tuple with the DynamicPorts field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkResource) GetDynamicPortsOk() (*[]Port, bool) { +func (o *NetworkResource) GetDynamicPortsOk() ([]Port, bool) { if o == nil || o.DynamicPorts == nil { return nil, false } @@ -170,7 +180,7 @@ func (o *NetworkResource) HasDynamicPorts() bool { // SetDynamicPorts gets a reference to the given []Port and assigns it to the DynamicPorts field. func (o *NetworkResource) SetDynamicPorts(v []Port) { - o.DynamicPorts = &v + o.DynamicPorts = v } // GetHostname returns the Hostname field value if set, zero value otherwise. @@ -307,12 +317,12 @@ func (o *NetworkResource) GetReservedPorts() []Port { var ret []Port return ret } - return *o.ReservedPorts + return o.ReservedPorts } // GetReservedPortsOk returns a tuple with the ReservedPorts field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkResource) GetReservedPortsOk() (*[]Port, bool) { +func (o *NetworkResource) GetReservedPortsOk() ([]Port, bool) { if o == nil || o.ReservedPorts == nil { return nil, false } @@ -330,7 +340,7 @@ func (o *NetworkResource) HasReservedPorts() bool { // SetReservedPorts gets a reference to the given []Port and assigns it to the ReservedPorts field. func (o *NetworkResource) SetReservedPorts(v []Port) { - o.ReservedPorts = &v + o.ReservedPorts = v } func (o NetworkResource) MarshalJSON() ([]byte, error) { @@ -338,8 +348,8 @@ func (o NetworkResource) MarshalJSON() ([]byte, error) { if o.CIDR != nil { toSerialize["CIDR"] = o.CIDR } - if o.DNS != nil { - toSerialize["DNS"] = o.DNS + if o.DNS.IsSet() { + toSerialize["DNS"] = o.DNS.Get() } if o.Device != nil { toSerialize["Device"] = o.Device diff --git a/clients/go/v1/model_node.go b/clients/go/v1/model_node.go index 3a5774c6..f015bc11 100644 --- a/clients/go/v1/model_node.go +++ b/clients/go/v1/model_node.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,23 +24,23 @@ type Node struct { CreateIndex *int32 `json:"CreateIndex,omitempty"` Datacenter *string `json:"Datacenter,omitempty"` Drain *bool `json:"Drain,omitempty"` - DrainStrategy *DrainStrategy `json:"DrainStrategy,omitempty"` + DrainStrategy NullableDrainStrategy `json:"DrainStrategy,omitempty"` Drivers *map[string]DriverInfo `json:"Drivers,omitempty"` - Events *[]NodeEvent `json:"Events,omitempty"` + Events []NodeEvent `json:"Events,omitempty"` HTTPAddr *string `json:"HTTPAddr,omitempty"` HostNetworks *map[string]HostNetworkInfo `json:"HostNetworks,omitempty"` HostVolumes *map[string]HostVolumeInfo `json:"HostVolumes,omitempty"` ID *string `json:"ID,omitempty"` - LastDrain *DrainMetadata `json:"LastDrain,omitempty"` + LastDrain NullableDrainMetadata `json:"LastDrain,omitempty"` Links *map[string]string `json:"Links,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Name *string `json:"Name,omitempty"` NodeClass *string `json:"NodeClass,omitempty"` - NodeResources *NodeResources `json:"NodeResources,omitempty"` - Reserved *Resources `json:"Reserved,omitempty"` - ReservedResources *NodeReservedResources `json:"ReservedResources,omitempty"` - Resources *Resources `json:"Resources,omitempty"` + NodeResources NullableNodeResources `json:"NodeResources,omitempty"` + Reserved NullableResources `json:"Reserved,omitempty"` + ReservedResources NullableNodeReservedResources `json:"ReservedResources,omitempty"` + Resources NullableResources `json:"Resources,omitempty"` SchedulingEligibility *string `json:"SchedulingEligibility,omitempty"` Status *string `json:"Status,omitempty"` StatusDescription *string `json:"StatusDescription,omitempty"` @@ -289,36 +289,46 @@ func (o *Node) SetDrain(v bool) { o.Drain = &v } -// GetDrainStrategy returns the DrainStrategy field value if set, zero value otherwise. +// GetDrainStrategy returns the DrainStrategy field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Node) GetDrainStrategy() DrainStrategy { - if o == nil || o.DrainStrategy == nil { + if o == nil || o.DrainStrategy.Get() == nil { var ret DrainStrategy return ret } - return *o.DrainStrategy + return *o.DrainStrategy.Get() } // GetDrainStrategyOk returns a tuple with the DrainStrategy field value if set, nil otherwise // 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 *Node) GetDrainStrategyOk() (*DrainStrategy, bool) { - if o == nil || o.DrainStrategy == nil { + if o == nil { return nil, false } - return o.DrainStrategy, true + return o.DrainStrategy.Get(), o.DrainStrategy.IsSet() } // HasDrainStrategy returns a boolean if a field has been set. func (o *Node) HasDrainStrategy() bool { - if o != nil && o.DrainStrategy != nil { + if o != nil && o.DrainStrategy.IsSet() { return true } return false } -// SetDrainStrategy gets a reference to the given DrainStrategy and assigns it to the DrainStrategy field. +// SetDrainStrategy gets a reference to the given NullableDrainStrategy and assigns it to the DrainStrategy field. func (o *Node) SetDrainStrategy(v DrainStrategy) { - o.DrainStrategy = &v + o.DrainStrategy.Set(&v) +} +// SetDrainStrategyNil sets the value for DrainStrategy to be an explicit nil +func (o *Node) SetDrainStrategyNil() { + o.DrainStrategy.Set(nil) +} + +// UnsetDrainStrategy ensures that no value is present for DrainStrategy, not even an explicit nil +func (o *Node) UnsetDrainStrategy() { + o.DrainStrategy.Unset() } // GetDrivers returns the Drivers field value if set, zero value otherwise. @@ -359,12 +369,12 @@ func (o *Node) GetEvents() []NodeEvent { var ret []NodeEvent return ret } - return *o.Events + return o.Events } // GetEventsOk returns a tuple with the Events field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Node) GetEventsOk() (*[]NodeEvent, bool) { +func (o *Node) GetEventsOk() ([]NodeEvent, bool) { if o == nil || o.Events == nil { return nil, false } @@ -382,7 +392,7 @@ func (o *Node) HasEvents() bool { // SetEvents gets a reference to the given []NodeEvent and assigns it to the Events field. func (o *Node) SetEvents(v []NodeEvent) { - o.Events = &v + o.Events = v } // GetHTTPAddr returns the HTTPAddr field value if set, zero value otherwise. @@ -513,36 +523,46 @@ func (o *Node) SetID(v string) { o.ID = &v } -// GetLastDrain returns the LastDrain field value if set, zero value otherwise. +// GetLastDrain returns the LastDrain field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Node) GetLastDrain() DrainMetadata { - if o == nil || o.LastDrain == nil { + if o == nil || o.LastDrain.Get() == nil { var ret DrainMetadata return ret } - return *o.LastDrain + return *o.LastDrain.Get() } // GetLastDrainOk returns a tuple with the LastDrain field value if set, nil otherwise // 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 *Node) GetLastDrainOk() (*DrainMetadata, bool) { - if o == nil || o.LastDrain == nil { + if o == nil { return nil, false } - return o.LastDrain, true + return o.LastDrain.Get(), o.LastDrain.IsSet() } // HasLastDrain returns a boolean if a field has been set. func (o *Node) HasLastDrain() bool { - if o != nil && o.LastDrain != nil { + if o != nil && o.LastDrain.IsSet() { return true } return false } -// SetLastDrain gets a reference to the given DrainMetadata and assigns it to the LastDrain field. +// SetLastDrain gets a reference to the given NullableDrainMetadata and assigns it to the LastDrain field. func (o *Node) SetLastDrain(v DrainMetadata) { - o.LastDrain = &v + o.LastDrain.Set(&v) +} +// SetLastDrainNil sets the value for LastDrain to be an explicit nil +func (o *Node) SetLastDrainNil() { + o.LastDrain.Set(nil) +} + +// UnsetLastDrain ensures that no value is present for LastDrain, not even an explicit nil +func (o *Node) UnsetLastDrain() { + o.LastDrain.Unset() } // GetLinks returns the Links field value if set, zero value otherwise. @@ -705,132 +725,172 @@ func (o *Node) SetNodeClass(v string) { o.NodeClass = &v } -// GetNodeResources returns the NodeResources field value if set, zero value otherwise. +// GetNodeResources returns the NodeResources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Node) GetNodeResources() NodeResources { - if o == nil || o.NodeResources == nil { + if o == nil || o.NodeResources.Get() == nil { var ret NodeResources return ret } - return *o.NodeResources + return *o.NodeResources.Get() } // GetNodeResourcesOk returns a tuple with the NodeResources field value if set, nil otherwise // 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 *Node) GetNodeResourcesOk() (*NodeResources, bool) { - if o == nil || o.NodeResources == nil { + if o == nil { return nil, false } - return o.NodeResources, true + return o.NodeResources.Get(), o.NodeResources.IsSet() } // HasNodeResources returns a boolean if a field has been set. func (o *Node) HasNodeResources() bool { - if o != nil && o.NodeResources != nil { + if o != nil && o.NodeResources.IsSet() { return true } return false } -// SetNodeResources gets a reference to the given NodeResources and assigns it to the NodeResources field. +// SetNodeResources gets a reference to the given NullableNodeResources and assigns it to the NodeResources field. func (o *Node) SetNodeResources(v NodeResources) { - o.NodeResources = &v + o.NodeResources.Set(&v) +} +// SetNodeResourcesNil sets the value for NodeResources to be an explicit nil +func (o *Node) SetNodeResourcesNil() { + o.NodeResources.Set(nil) +} + +// UnsetNodeResources ensures that no value is present for NodeResources, not even an explicit nil +func (o *Node) UnsetNodeResources() { + o.NodeResources.Unset() } -// GetReserved returns the Reserved field value if set, zero value otherwise. +// GetReserved returns the Reserved field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Node) GetReserved() Resources { - if o == nil || o.Reserved == nil { + if o == nil || o.Reserved.Get() == nil { var ret Resources return ret } - return *o.Reserved + return *o.Reserved.Get() } // GetReservedOk returns a tuple with the Reserved field value if set, nil otherwise // 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 *Node) GetReservedOk() (*Resources, bool) { - if o == nil || o.Reserved == nil { + if o == nil { return nil, false } - return o.Reserved, true + return o.Reserved.Get(), o.Reserved.IsSet() } // HasReserved returns a boolean if a field has been set. func (o *Node) HasReserved() bool { - if o != nil && o.Reserved != nil { + if o != nil && o.Reserved.IsSet() { return true } return false } -// SetReserved gets a reference to the given Resources and assigns it to the Reserved field. +// SetReserved gets a reference to the given NullableResources and assigns it to the Reserved field. func (o *Node) SetReserved(v Resources) { - o.Reserved = &v + o.Reserved.Set(&v) +} +// SetReservedNil sets the value for Reserved to be an explicit nil +func (o *Node) SetReservedNil() { + o.Reserved.Set(nil) } -// GetReservedResources returns the ReservedResources field value if set, zero value otherwise. +// UnsetReserved ensures that no value is present for Reserved, not even an explicit nil +func (o *Node) UnsetReserved() { + o.Reserved.Unset() +} + +// GetReservedResources returns the ReservedResources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Node) GetReservedResources() NodeReservedResources { - if o == nil || o.ReservedResources == nil { + if o == nil || o.ReservedResources.Get() == nil { var ret NodeReservedResources return ret } - return *o.ReservedResources + return *o.ReservedResources.Get() } // GetReservedResourcesOk returns a tuple with the ReservedResources field value if set, nil otherwise // 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 *Node) GetReservedResourcesOk() (*NodeReservedResources, bool) { - if o == nil || o.ReservedResources == nil { + if o == nil { return nil, false } - return o.ReservedResources, true + return o.ReservedResources.Get(), o.ReservedResources.IsSet() } // HasReservedResources returns a boolean if a field has been set. func (o *Node) HasReservedResources() bool { - if o != nil && o.ReservedResources != nil { + if o != nil && o.ReservedResources.IsSet() { return true } return false } -// SetReservedResources gets a reference to the given NodeReservedResources and assigns it to the ReservedResources field. +// SetReservedResources gets a reference to the given NullableNodeReservedResources and assigns it to the ReservedResources field. func (o *Node) SetReservedResources(v NodeReservedResources) { - o.ReservedResources = &v + o.ReservedResources.Set(&v) +} +// SetReservedResourcesNil sets the value for ReservedResources to be an explicit nil +func (o *Node) SetReservedResourcesNil() { + o.ReservedResources.Set(nil) } -// GetResources returns the Resources field value if set, zero value otherwise. +// UnsetReservedResources ensures that no value is present for ReservedResources, not even an explicit nil +func (o *Node) UnsetReservedResources() { + o.ReservedResources.Unset() +} + +// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Node) GetResources() Resources { - if o == nil || o.Resources == nil { + if o == nil || o.Resources.Get() == nil { var ret Resources return ret } - return *o.Resources + return *o.Resources.Get() } // GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise // 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 *Node) GetResourcesOk() (*Resources, bool) { - if o == nil || o.Resources == nil { + if o == nil { return nil, false } - return o.Resources, true + return o.Resources.Get(), o.Resources.IsSet() } // HasResources returns a boolean if a field has been set. func (o *Node) HasResources() bool { - if o != nil && o.Resources != nil { + if o != nil && o.Resources.IsSet() { return true } return false } -// SetResources gets a reference to the given Resources and assigns it to the Resources field. +// SetResources gets a reference to the given NullableResources and assigns it to the Resources field. func (o *Node) SetResources(v Resources) { - o.Resources = &v + o.Resources.Set(&v) +} +// SetResourcesNil sets the value for Resources to be an explicit nil +func (o *Node) SetResourcesNil() { + o.Resources.Set(nil) +} + +// UnsetResources ensures that no value is present for Resources, not even an explicit nil +func (o *Node) UnsetResources() { + o.Resources.Unset() } // GetSchedulingEligibility returns the SchedulingEligibility field value if set, zero value otherwise. @@ -1016,8 +1076,8 @@ func (o Node) MarshalJSON() ([]byte, error) { if o.Drain != nil { toSerialize["Drain"] = o.Drain } - if o.DrainStrategy != nil { - toSerialize["DrainStrategy"] = o.DrainStrategy + if o.DrainStrategy.IsSet() { + toSerialize["DrainStrategy"] = o.DrainStrategy.Get() } if o.Drivers != nil { toSerialize["Drivers"] = o.Drivers @@ -1037,8 +1097,8 @@ func (o Node) MarshalJSON() ([]byte, error) { if o.ID != nil { toSerialize["ID"] = o.ID } - if o.LastDrain != nil { - toSerialize["LastDrain"] = o.LastDrain + if o.LastDrain.IsSet() { + toSerialize["LastDrain"] = o.LastDrain.Get() } if o.Links != nil { toSerialize["Links"] = o.Links @@ -1055,17 +1115,17 @@ func (o Node) MarshalJSON() ([]byte, error) { if o.NodeClass != nil { toSerialize["NodeClass"] = o.NodeClass } - if o.NodeResources != nil { - toSerialize["NodeResources"] = o.NodeResources + if o.NodeResources.IsSet() { + toSerialize["NodeResources"] = o.NodeResources.Get() } - if o.Reserved != nil { - toSerialize["Reserved"] = o.Reserved + if o.Reserved.IsSet() { + toSerialize["Reserved"] = o.Reserved.Get() } - if o.ReservedResources != nil { - toSerialize["ReservedResources"] = o.ReservedResources + if o.ReservedResources.IsSet() { + toSerialize["ReservedResources"] = o.ReservedResources.Get() } - if o.Resources != nil { - toSerialize["Resources"] = o.Resources + if o.Resources.IsSet() { + toSerialize["Resources"] = o.Resources.Get() } if o.SchedulingEligibility != nil { toSerialize["SchedulingEligibility"] = o.SchedulingEligibility diff --git a/clients/go/v1/model_node_cpu_resources.go b/clients/go/v1/model_node_cpu_resources.go index ab172992..76145cf7 100644 --- a/clients/go/v1/model_node_cpu_resources.go +++ b/clients/go/v1/model_node_cpu_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // NodeCpuResources struct for NodeCpuResources type NodeCpuResources struct { CpuShares *int64 `json:"CpuShares,omitempty"` - ReservableCpuCores *[]int32 `json:"ReservableCpuCores,omitempty"` + ReservableCpuCores []int32 `json:"ReservableCpuCores,omitempty"` TotalCpuCores *int32 `json:"TotalCpuCores,omitempty"` } @@ -77,12 +77,12 @@ func (o *NodeCpuResources) GetReservableCpuCores() []int32 { var ret []int32 return ret } - return *o.ReservableCpuCores + return o.ReservableCpuCores } // GetReservableCpuCoresOk returns a tuple with the ReservableCpuCores field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeCpuResources) GetReservableCpuCoresOk() (*[]int32, bool) { +func (o *NodeCpuResources) GetReservableCpuCoresOk() ([]int32, bool) { if o == nil || o.ReservableCpuCores == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *NodeCpuResources) HasReservableCpuCores() bool { // SetReservableCpuCores gets a reference to the given []int32 and assigns it to the ReservableCpuCores field. func (o *NodeCpuResources) SetReservableCpuCores(v []int32) { - o.ReservableCpuCores = &v + o.ReservableCpuCores = v } // GetTotalCpuCores returns the TotalCpuCores field value if set, zero value otherwise. diff --git a/clients/go/v1/model_node_device.go b/clients/go/v1/model_node_device.go index 6ae419e5..3e950c91 100644 --- a/clients/go/v1/model_node_device.go +++ b/clients/go/v1/model_node_device.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ type NodeDevice struct { HealthDescription *string `json:"HealthDescription,omitempty"` Healthy *bool `json:"Healthy,omitempty"` ID *string `json:"ID,omitempty"` - Locality *NodeDeviceLocality `json:"Locality,omitempty"` + Locality NullableNodeDeviceLocality `json:"Locality,omitempty"` } // NewNodeDevice instantiates a new NodeDevice object @@ -136,36 +136,46 @@ func (o *NodeDevice) SetID(v string) { o.ID = &v } -// GetLocality returns the Locality field value if set, zero value otherwise. +// GetLocality returns the Locality field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeDevice) GetLocality() NodeDeviceLocality { - if o == nil || o.Locality == nil { + if o == nil || o.Locality.Get() == nil { var ret NodeDeviceLocality return ret } - return *o.Locality + return *o.Locality.Get() } // GetLocalityOk returns a tuple with the Locality field value if set, nil otherwise // 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 *NodeDevice) GetLocalityOk() (*NodeDeviceLocality, bool) { - if o == nil || o.Locality == nil { + if o == nil { return nil, false } - return o.Locality, true + return o.Locality.Get(), o.Locality.IsSet() } // HasLocality returns a boolean if a field has been set. func (o *NodeDevice) HasLocality() bool { - if o != nil && o.Locality != nil { + if o != nil && o.Locality.IsSet() { return true } return false } -// SetLocality gets a reference to the given NodeDeviceLocality and assigns it to the Locality field. +// SetLocality gets a reference to the given NullableNodeDeviceLocality and assigns it to the Locality field. func (o *NodeDevice) SetLocality(v NodeDeviceLocality) { - o.Locality = &v + o.Locality.Set(&v) +} +// SetLocalityNil sets the value for Locality to be an explicit nil +func (o *NodeDevice) SetLocalityNil() { + o.Locality.Set(nil) +} + +// UnsetLocality ensures that no value is present for Locality, not even an explicit nil +func (o *NodeDevice) UnsetLocality() { + o.Locality.Unset() } func (o NodeDevice) MarshalJSON() ([]byte, error) { @@ -179,8 +189,8 @@ func (o NodeDevice) MarshalJSON() ([]byte, error) { if o.ID != nil { toSerialize["ID"] = o.ID } - if o.Locality != nil { - toSerialize["Locality"] = o.Locality + if o.Locality.IsSet() { + toSerialize["Locality"] = o.Locality.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_node_device_locality.go b/clients/go/v1/model_node_device_locality.go index 6a1121b2..ec1605b5 100644 --- a/clients/go/v1/model_node_device_locality.go +++ b/clients/go/v1/model_node_device_locality.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_device_resource.go b/clients/go/v1/model_node_device_resource.go index 3b987627..5f04b82f 100644 --- a/clients/go/v1/model_node_device_resource.go +++ b/clients/go/v1/model_node_device_resource.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // NodeDeviceResource struct for NodeDeviceResource type NodeDeviceResource struct { Attributes *map[string]Attribute `json:"Attributes,omitempty"` - Instances *[]NodeDevice `json:"Instances,omitempty"` + Instances []NodeDevice `json:"Instances,omitempty"` Name *string `json:"Name,omitempty"` Type *string `json:"Type,omitempty"` Vendor *string `json:"Vendor,omitempty"` @@ -79,12 +79,12 @@ func (o *NodeDeviceResource) GetInstances() []NodeDevice { var ret []NodeDevice return ret } - return *o.Instances + return o.Instances } // GetInstancesOk returns a tuple with the Instances field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeDeviceResource) GetInstancesOk() (*[]NodeDevice, bool) { +func (o *NodeDeviceResource) GetInstancesOk() ([]NodeDevice, bool) { if o == nil || o.Instances == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *NodeDeviceResource) HasInstances() bool { // SetInstances gets a reference to the given []NodeDevice and assigns it to the Instances field. func (o *NodeDeviceResource) SetInstances(v []NodeDevice) { - o.Instances = &v + o.Instances = v } // GetName returns the Name field value if set, zero value otherwise. diff --git a/clients/go/v1/model_node_disk_resources.go b/clients/go/v1/model_node_disk_resources.go index 1b2a160a..d549304c 100644 --- a/clients/go/v1/model_node_disk_resources.go +++ b/clients/go/v1/model_node_disk_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_drain_update_response.go b/clients/go/v1/model_node_drain_update_response.go index 25d29268..630eff88 100644 --- a/clients/go/v1/model_node_drain_update_response.go +++ b/clients/go/v1/model_node_drain_update_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // NodeDrainUpdateResponse struct for NodeDrainUpdateResponse type NodeDrainUpdateResponse struct { EvalCreateIndex *int32 `json:"EvalCreateIndex,omitempty"` - EvalIDs *[]string `json:"EvalIDs,omitempty"` + EvalIDs []string `json:"EvalIDs,omitempty"` LastIndex *int32 `json:"LastIndex,omitempty"` NodeModifyIndex *int32 `json:"NodeModifyIndex,omitempty"` RequestTime *int64 `json:"RequestTime,omitempty"` @@ -79,12 +79,12 @@ func (o *NodeDrainUpdateResponse) GetEvalIDs() []string { var ret []string return ret } - return *o.EvalIDs + return o.EvalIDs } // GetEvalIDsOk returns a tuple with the EvalIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeDrainUpdateResponse) GetEvalIDsOk() (*[]string, bool) { +func (o *NodeDrainUpdateResponse) GetEvalIDsOk() ([]string, bool) { if o == nil || o.EvalIDs == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *NodeDrainUpdateResponse) HasEvalIDs() bool { // SetEvalIDs gets a reference to the given []string and assigns it to the EvalIDs field. func (o *NodeDrainUpdateResponse) SetEvalIDs(v []string) { - o.EvalIDs = &v + o.EvalIDs = v } // GetLastIndex returns the LastIndex field value if set, zero value otherwise. diff --git a/clients/go/v1/model_node_eligibility_update_response.go b/clients/go/v1/model_node_eligibility_update_response.go index e03af47e..7b642e86 100644 --- a/clients/go/v1/model_node_eligibility_update_response.go +++ b/clients/go/v1/model_node_eligibility_update_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // NodeEligibilityUpdateResponse struct for NodeEligibilityUpdateResponse type NodeEligibilityUpdateResponse struct { EvalCreateIndex *int32 `json:"EvalCreateIndex,omitempty"` - EvalIDs *[]string `json:"EvalIDs,omitempty"` + EvalIDs []string `json:"EvalIDs,omitempty"` LastIndex *int32 `json:"LastIndex,omitempty"` NodeModifyIndex *int32 `json:"NodeModifyIndex,omitempty"` RequestTime *int64 `json:"RequestTime,omitempty"` @@ -79,12 +79,12 @@ func (o *NodeEligibilityUpdateResponse) GetEvalIDs() []string { var ret []string return ret } - return *o.EvalIDs + return o.EvalIDs } // GetEvalIDsOk returns a tuple with the EvalIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeEligibilityUpdateResponse) GetEvalIDsOk() (*[]string, bool) { +func (o *NodeEligibilityUpdateResponse) GetEvalIDsOk() ([]string, bool) { if o == nil || o.EvalIDs == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *NodeEligibilityUpdateResponse) HasEvalIDs() bool { // SetEvalIDs gets a reference to the given []string and assigns it to the EvalIDs field. func (o *NodeEligibilityUpdateResponse) SetEvalIDs(v []string) { - o.EvalIDs = &v + o.EvalIDs = v } // GetLastIndex returns the LastIndex field value if set, zero value otherwise. diff --git a/clients/go/v1/model_node_event.go b/clients/go/v1/model_node_event.go index a1227f3c..0d2111ed 100644 --- a/clients/go/v1/model_node_event.go +++ b/clients/go/v1/model_node_event.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type NodeEvent struct { Details *map[string]string `json:"Details,omitempty"` Message *string `json:"Message,omitempty"` Subsystem *string `json:"Subsystem,omitempty"` - Timestamp *time.Time `json:"Timestamp,omitempty"` + Timestamp NullableTime `json:"Timestamp,omitempty"` } // NewNodeEvent instantiates a new NodeEvent object @@ -170,36 +170,46 @@ func (o *NodeEvent) SetSubsystem(v string) { o.Subsystem = &v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeEvent) GetTimestamp() time.Time { - if o == nil || o.Timestamp == nil { + if o == nil || o.Timestamp.Get() == nil { var ret time.Time return ret } - return *o.Timestamp + return *o.Timestamp.Get() } // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // 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 *NodeEvent) GetTimestampOk() (*time.Time, bool) { - if o == nil || o.Timestamp == nil { + if o == nil { return nil, false } - return o.Timestamp, true + return o.Timestamp.Get(), o.Timestamp.IsSet() } // HasTimestamp returns a boolean if a field has been set. func (o *NodeEvent) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { + if o != nil && o.Timestamp.IsSet() { return true } return false } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp gets a reference to the given NullableTime and assigns it to the Timestamp field. func (o *NodeEvent) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp.Set(&v) +} +// SetTimestampNil sets the value for Timestamp to be an explicit nil +func (o *NodeEvent) SetTimestampNil() { + o.Timestamp.Set(nil) +} + +// UnsetTimestamp ensures that no value is present for Timestamp, not even an explicit nil +func (o *NodeEvent) UnsetTimestamp() { + o.Timestamp.Unset() } func (o NodeEvent) MarshalJSON() ([]byte, error) { @@ -216,8 +226,8 @@ func (o NodeEvent) MarshalJSON() ([]byte, error) { if o.Subsystem != nil { toSerialize["Subsystem"] = o.Subsystem } - if o.Timestamp != nil { - toSerialize["Timestamp"] = o.Timestamp + if o.Timestamp.IsSet() { + toSerialize["Timestamp"] = o.Timestamp.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_node_list_stub.go b/clients/go/v1/model_node_list_stub.go index 32bad0ed..edc7ecbc 100644 --- a/clients/go/v1/model_node_list_stub.go +++ b/clients/go/v1/model_node_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,12 +24,12 @@ type NodeListStub struct { Drain *bool `json:"Drain,omitempty"` Drivers *map[string]DriverInfo `json:"Drivers,omitempty"` ID *string `json:"ID,omitempty"` - LastDrain *DrainMetadata `json:"LastDrain,omitempty"` + LastDrain NullableDrainMetadata `json:"LastDrain,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Name *string `json:"Name,omitempty"` NodeClass *string `json:"NodeClass,omitempty"` - NodeResources *NodeResources `json:"NodeResources,omitempty"` - ReservedResources *NodeReservedResources `json:"ReservedResources,omitempty"` + NodeResources NullableNodeResources `json:"NodeResources,omitempty"` + ReservedResources NullableNodeReservedResources `json:"ReservedResources,omitempty"` SchedulingEligibility *string `json:"SchedulingEligibility,omitempty"` Status *string `json:"Status,omitempty"` StatusDescription *string `json:"StatusDescription,omitempty"` @@ -277,36 +277,46 @@ func (o *NodeListStub) SetID(v string) { o.ID = &v } -// GetLastDrain returns the LastDrain field value if set, zero value otherwise. +// GetLastDrain returns the LastDrain field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeListStub) GetLastDrain() DrainMetadata { - if o == nil || o.LastDrain == nil { + if o == nil || o.LastDrain.Get() == nil { var ret DrainMetadata return ret } - return *o.LastDrain + return *o.LastDrain.Get() } // GetLastDrainOk returns a tuple with the LastDrain field value if set, nil otherwise // 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 *NodeListStub) GetLastDrainOk() (*DrainMetadata, bool) { - if o == nil || o.LastDrain == nil { + if o == nil { return nil, false } - return o.LastDrain, true + return o.LastDrain.Get(), o.LastDrain.IsSet() } // HasLastDrain returns a boolean if a field has been set. func (o *NodeListStub) HasLastDrain() bool { - if o != nil && o.LastDrain != nil { + if o != nil && o.LastDrain.IsSet() { return true } return false } -// SetLastDrain gets a reference to the given DrainMetadata and assigns it to the LastDrain field. +// SetLastDrain gets a reference to the given NullableDrainMetadata and assigns it to the LastDrain field. func (o *NodeListStub) SetLastDrain(v DrainMetadata) { - o.LastDrain = &v + o.LastDrain.Set(&v) +} +// SetLastDrainNil sets the value for LastDrain to be an explicit nil +func (o *NodeListStub) SetLastDrainNil() { + o.LastDrain.Set(nil) +} + +// UnsetLastDrain ensures that no value is present for LastDrain, not even an explicit nil +func (o *NodeListStub) UnsetLastDrain() { + o.LastDrain.Unset() } // GetModifyIndex returns the ModifyIndex field value if set, zero value otherwise. @@ -405,68 +415,88 @@ func (o *NodeListStub) SetNodeClass(v string) { o.NodeClass = &v } -// GetNodeResources returns the NodeResources field value if set, zero value otherwise. +// GetNodeResources returns the NodeResources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeListStub) GetNodeResources() NodeResources { - if o == nil || o.NodeResources == nil { + if o == nil || o.NodeResources.Get() == nil { var ret NodeResources return ret } - return *o.NodeResources + return *o.NodeResources.Get() } // GetNodeResourcesOk returns a tuple with the NodeResources field value if set, nil otherwise // 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 *NodeListStub) GetNodeResourcesOk() (*NodeResources, bool) { - if o == nil || o.NodeResources == nil { + if o == nil { return nil, false } - return o.NodeResources, true + return o.NodeResources.Get(), o.NodeResources.IsSet() } // HasNodeResources returns a boolean if a field has been set. func (o *NodeListStub) HasNodeResources() bool { - if o != nil && o.NodeResources != nil { + if o != nil && o.NodeResources.IsSet() { return true } return false } -// SetNodeResources gets a reference to the given NodeResources and assigns it to the NodeResources field. +// SetNodeResources gets a reference to the given NullableNodeResources and assigns it to the NodeResources field. func (o *NodeListStub) SetNodeResources(v NodeResources) { - o.NodeResources = &v + o.NodeResources.Set(&v) +} +// SetNodeResourcesNil sets the value for NodeResources to be an explicit nil +func (o *NodeListStub) SetNodeResourcesNil() { + o.NodeResources.Set(nil) } -// GetReservedResources returns the ReservedResources field value if set, zero value otherwise. +// UnsetNodeResources ensures that no value is present for NodeResources, not even an explicit nil +func (o *NodeListStub) UnsetNodeResources() { + o.NodeResources.Unset() +} + +// GetReservedResources returns the ReservedResources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeListStub) GetReservedResources() NodeReservedResources { - if o == nil || o.ReservedResources == nil { + if o == nil || o.ReservedResources.Get() == nil { var ret NodeReservedResources return ret } - return *o.ReservedResources + return *o.ReservedResources.Get() } // GetReservedResourcesOk returns a tuple with the ReservedResources field value if set, nil otherwise // 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 *NodeListStub) GetReservedResourcesOk() (*NodeReservedResources, bool) { - if o == nil || o.ReservedResources == nil { + if o == nil { return nil, false } - return o.ReservedResources, true + return o.ReservedResources.Get(), o.ReservedResources.IsSet() } // HasReservedResources returns a boolean if a field has been set. func (o *NodeListStub) HasReservedResources() bool { - if o != nil && o.ReservedResources != nil { + if o != nil && o.ReservedResources.IsSet() { return true } return false } -// SetReservedResources gets a reference to the given NodeReservedResources and assigns it to the ReservedResources field. +// SetReservedResources gets a reference to the given NullableNodeReservedResources and assigns it to the ReservedResources field. func (o *NodeListStub) SetReservedResources(v NodeReservedResources) { - o.ReservedResources = &v + o.ReservedResources.Set(&v) +} +// SetReservedResourcesNil sets the value for ReservedResources to be an explicit nil +func (o *NodeListStub) SetReservedResourcesNil() { + o.ReservedResources.Set(nil) +} + +// UnsetReservedResources ensures that no value is present for ReservedResources, not even an explicit nil +func (o *NodeListStub) UnsetReservedResources() { + o.ReservedResources.Unset() } // GetSchedulingEligibility returns the SchedulingEligibility field value if set, zero value otherwise. @@ -620,8 +650,8 @@ func (o NodeListStub) MarshalJSON() ([]byte, error) { if o.ID != nil { toSerialize["ID"] = o.ID } - if o.LastDrain != nil { - toSerialize["LastDrain"] = o.LastDrain + if o.LastDrain.IsSet() { + toSerialize["LastDrain"] = o.LastDrain.Get() } if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex @@ -632,11 +662,11 @@ func (o NodeListStub) MarshalJSON() ([]byte, error) { if o.NodeClass != nil { toSerialize["NodeClass"] = o.NodeClass } - if o.NodeResources != nil { - toSerialize["NodeResources"] = o.NodeResources + if o.NodeResources.IsSet() { + toSerialize["NodeResources"] = o.NodeResources.Get() } - if o.ReservedResources != nil { - toSerialize["ReservedResources"] = o.ReservedResources + if o.ReservedResources.IsSet() { + toSerialize["ReservedResources"] = o.ReservedResources.Get() } if o.SchedulingEligibility != nil { toSerialize["SchedulingEligibility"] = o.SchedulingEligibility diff --git a/clients/go/v1/model_node_memory_resources.go b/clients/go/v1/model_node_memory_resources.go index a8226d6c..0e17fbb9 100644 --- a/clients/go/v1/model_node_memory_resources.go +++ b/clients/go/v1/model_node_memory_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_purge_response.go b/clients/go/v1/model_node_purge_response.go index 9ef5dcce..847e77d5 100644 --- a/clients/go/v1/model_node_purge_response.go +++ b/clients/go/v1/model_node_purge_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // NodePurgeResponse struct for NodePurgeResponse type NodePurgeResponse struct { EvalCreateIndex *int32 `json:"EvalCreateIndex,omitempty"` - EvalIDs *[]string `json:"EvalIDs,omitempty"` + EvalIDs []string `json:"EvalIDs,omitempty"` NodeModifyIndex *int32 `json:"NodeModifyIndex,omitempty"` } @@ -77,12 +77,12 @@ func (o *NodePurgeResponse) GetEvalIDs() []string { var ret []string return ret } - return *o.EvalIDs + return o.EvalIDs } // GetEvalIDsOk returns a tuple with the EvalIDs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodePurgeResponse) GetEvalIDsOk() (*[]string, bool) { +func (o *NodePurgeResponse) GetEvalIDsOk() ([]string, bool) { if o == nil || o.EvalIDs == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *NodePurgeResponse) HasEvalIDs() bool { // SetEvalIDs gets a reference to the given []string and assigns it to the EvalIDs field. func (o *NodePurgeResponse) SetEvalIDs(v []string) { - o.EvalIDs = &v + o.EvalIDs = v } // GetNodeModifyIndex returns the NodeModifyIndex field value if set, zero value otherwise. diff --git a/clients/go/v1/model_node_reserved_cpu_resources.go b/clients/go/v1/model_node_reserved_cpu_resources.go index f984c344..16f5fe9f 100644 --- a/clients/go/v1/model_node_reserved_cpu_resources.go +++ b/clients/go/v1/model_node_reserved_cpu_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_reserved_disk_resources.go b/clients/go/v1/model_node_reserved_disk_resources.go index 0eb4a377..83e425f4 100644 --- a/clients/go/v1/model_node_reserved_disk_resources.go +++ b/clients/go/v1/model_node_reserved_disk_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_reserved_memory_resources.go b/clients/go/v1/model_node_reserved_memory_resources.go index 1198f87b..6d58d958 100644 --- a/clients/go/v1/model_node_reserved_memory_resources.go +++ b/clients/go/v1/model_node_reserved_memory_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_reserved_network_resources.go b/clients/go/v1/model_node_reserved_network_resources.go index 7b4e3ed1..d5b04648 100644 --- a/clients/go/v1/model_node_reserved_network_resources.go +++ b/clients/go/v1/model_node_reserved_network_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_reserved_resources.go b/clients/go/v1/model_node_reserved_resources.go index 29d1f590..e8481d95 100644 --- a/clients/go/v1/model_node_reserved_resources.go +++ b/clients/go/v1/model_node_reserved_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // NodeReservedResources struct for NodeReservedResources type NodeReservedResources struct { - Cpu *NodeReservedCpuResources `json:"Cpu,omitempty"` - Disk *NodeReservedDiskResources `json:"Disk,omitempty"` - Memory *NodeReservedMemoryResources `json:"Memory,omitempty"` - Networks *NodeReservedNetworkResources `json:"Networks,omitempty"` + Cpu NullableNodeReservedCpuResources `json:"Cpu,omitempty"` + Disk NullableNodeReservedDiskResources `json:"Disk,omitempty"` + Memory NullableNodeReservedMemoryResources `json:"Memory,omitempty"` + Networks NullableNodeReservedNetworkResources `json:"Networks,omitempty"` } // NewNodeReservedResources instantiates a new NodeReservedResources object @@ -40,147 +40,187 @@ func NewNodeReservedResourcesWithDefaults() *NodeReservedResources { return &this } -// GetCpu returns the Cpu field value if set, zero value otherwise. +// GetCpu returns the Cpu field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeReservedResources) GetCpu() NodeReservedCpuResources { - if o == nil || o.Cpu == nil { + if o == nil || o.Cpu.Get() == nil { var ret NodeReservedCpuResources return ret } - return *o.Cpu + return *o.Cpu.Get() } // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise // 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 *NodeReservedResources) GetCpuOk() (*NodeReservedCpuResources, bool) { - if o == nil || o.Cpu == nil { + if o == nil { return nil, false } - return o.Cpu, true + return o.Cpu.Get(), o.Cpu.IsSet() } // HasCpu returns a boolean if a field has been set. func (o *NodeReservedResources) HasCpu() bool { - if o != nil && o.Cpu != nil { + if o != nil && o.Cpu.IsSet() { return true } return false } -// SetCpu gets a reference to the given NodeReservedCpuResources and assigns it to the Cpu field. +// SetCpu gets a reference to the given NullableNodeReservedCpuResources and assigns it to the Cpu field. func (o *NodeReservedResources) SetCpu(v NodeReservedCpuResources) { - o.Cpu = &v + o.Cpu.Set(&v) +} +// SetCpuNil sets the value for Cpu to be an explicit nil +func (o *NodeReservedResources) SetCpuNil() { + o.Cpu.Set(nil) } -// GetDisk returns the Disk field value if set, zero value otherwise. +// UnsetCpu ensures that no value is present for Cpu, not even an explicit nil +func (o *NodeReservedResources) UnsetCpu() { + o.Cpu.Unset() +} + +// GetDisk returns the Disk field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeReservedResources) GetDisk() NodeReservedDiskResources { - if o == nil || o.Disk == nil { + if o == nil || o.Disk.Get() == nil { var ret NodeReservedDiskResources return ret } - return *o.Disk + return *o.Disk.Get() } // GetDiskOk returns a tuple with the Disk field value if set, nil otherwise // 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 *NodeReservedResources) GetDiskOk() (*NodeReservedDiskResources, bool) { - if o == nil || o.Disk == nil { + if o == nil { return nil, false } - return o.Disk, true + return o.Disk.Get(), o.Disk.IsSet() } // HasDisk returns a boolean if a field has been set. func (o *NodeReservedResources) HasDisk() bool { - if o != nil && o.Disk != nil { + if o != nil && o.Disk.IsSet() { return true } return false } -// SetDisk gets a reference to the given NodeReservedDiskResources and assigns it to the Disk field. +// SetDisk gets a reference to the given NullableNodeReservedDiskResources and assigns it to the Disk field. func (o *NodeReservedResources) SetDisk(v NodeReservedDiskResources) { - o.Disk = &v + o.Disk.Set(&v) +} +// SetDiskNil sets the value for Disk to be an explicit nil +func (o *NodeReservedResources) SetDiskNil() { + o.Disk.Set(nil) +} + +// UnsetDisk ensures that no value is present for Disk, not even an explicit nil +func (o *NodeReservedResources) UnsetDisk() { + o.Disk.Unset() } -// GetMemory returns the Memory field value if set, zero value otherwise. +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeReservedResources) GetMemory() NodeReservedMemoryResources { - if o == nil || o.Memory == nil { + if o == nil || o.Memory.Get() == nil { var ret NodeReservedMemoryResources return ret } - return *o.Memory + return *o.Memory.Get() } // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise // 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 *NodeReservedResources) GetMemoryOk() (*NodeReservedMemoryResources, bool) { - if o == nil || o.Memory == nil { + if o == nil { return nil, false } - return o.Memory, true + return o.Memory.Get(), o.Memory.IsSet() } // HasMemory returns a boolean if a field has been set. func (o *NodeReservedResources) HasMemory() bool { - if o != nil && o.Memory != nil { + if o != nil && o.Memory.IsSet() { return true } return false } -// SetMemory gets a reference to the given NodeReservedMemoryResources and assigns it to the Memory field. +// SetMemory gets a reference to the given NullableNodeReservedMemoryResources and assigns it to the Memory field. func (o *NodeReservedResources) SetMemory(v NodeReservedMemoryResources) { - o.Memory = &v + o.Memory.Set(&v) +} +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *NodeReservedResources) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *NodeReservedResources) UnsetMemory() { + o.Memory.Unset() } -// GetNetworks returns the Networks field value if set, zero value otherwise. +// GetNetworks returns the Networks field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeReservedResources) GetNetworks() NodeReservedNetworkResources { - if o == nil || o.Networks == nil { + if o == nil || o.Networks.Get() == nil { var ret NodeReservedNetworkResources return ret } - return *o.Networks + return *o.Networks.Get() } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // 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 *NodeReservedResources) GetNetworksOk() (*NodeReservedNetworkResources, bool) { - if o == nil || o.Networks == nil { + if o == nil { return nil, false } - return o.Networks, true + return o.Networks.Get(), o.Networks.IsSet() } // HasNetworks returns a boolean if a field has been set. func (o *NodeReservedResources) HasNetworks() bool { - if o != nil && o.Networks != nil { + if o != nil && o.Networks.IsSet() { return true } return false } -// SetNetworks gets a reference to the given NodeReservedNetworkResources and assigns it to the Networks field. +// SetNetworks gets a reference to the given NullableNodeReservedNetworkResources and assigns it to the Networks field. func (o *NodeReservedResources) SetNetworks(v NodeReservedNetworkResources) { - o.Networks = &v + o.Networks.Set(&v) +} +// SetNetworksNil sets the value for Networks to be an explicit nil +func (o *NodeReservedResources) SetNetworksNil() { + o.Networks.Set(nil) +} + +// UnsetNetworks ensures that no value is present for Networks, not even an explicit nil +func (o *NodeReservedResources) UnsetNetworks() { + o.Networks.Unset() } func (o NodeReservedResources) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Cpu != nil { - toSerialize["Cpu"] = o.Cpu + if o.Cpu.IsSet() { + toSerialize["Cpu"] = o.Cpu.Get() } - if o.Disk != nil { - toSerialize["Disk"] = o.Disk + if o.Disk.IsSet() { + toSerialize["Disk"] = o.Disk.Get() } - if o.Memory != nil { - toSerialize["Memory"] = o.Memory + if o.Memory.IsSet() { + toSerialize["Memory"] = o.Memory.Get() } - if o.Networks != nil { - toSerialize["Networks"] = o.Networks + if o.Networks.IsSet() { + toSerialize["Networks"] = o.Networks.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_node_resources.go b/clients/go/v1/model_node_resources.go index 9b3b7281..bb38d8e8 100644 --- a/clients/go/v1/model_node_resources.go +++ b/clients/go/v1/model_node_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,13 +17,13 @@ import ( // NodeResources struct for NodeResources type NodeResources struct { - Cpu *NodeCpuResources `json:"Cpu,omitempty"` - Devices *[]NodeDeviceResource `json:"Devices,omitempty"` - Disk *NodeDiskResources `json:"Disk,omitempty"` + Cpu NullableNodeCpuResources `json:"Cpu,omitempty"` + Devices []NodeDeviceResource `json:"Devices,omitempty"` + Disk NullableNodeDiskResources `json:"Disk,omitempty"` MaxDynamicPort *int32 `json:"MaxDynamicPort,omitempty"` - Memory *NodeMemoryResources `json:"Memory,omitempty"` + Memory NullableNodeMemoryResources `json:"Memory,omitempty"` MinDynamicPort *int32 `json:"MinDynamicPort,omitempty"` - Networks *[]NetworkResource `json:"Networks,omitempty"` + Networks []NetworkResource `json:"Networks,omitempty"` } // NewNodeResources instantiates a new NodeResources object @@ -43,36 +43,46 @@ func NewNodeResourcesWithDefaults() *NodeResources { return &this } -// GetCpu returns the Cpu field value if set, zero value otherwise. +// GetCpu returns the Cpu field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeResources) GetCpu() NodeCpuResources { - if o == nil || o.Cpu == nil { + if o == nil || o.Cpu.Get() == nil { var ret NodeCpuResources return ret } - return *o.Cpu + return *o.Cpu.Get() } // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise // 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 *NodeResources) GetCpuOk() (*NodeCpuResources, bool) { - if o == nil || o.Cpu == nil { + if o == nil { return nil, false } - return o.Cpu, true + return o.Cpu.Get(), o.Cpu.IsSet() } // HasCpu returns a boolean if a field has been set. func (o *NodeResources) HasCpu() bool { - if o != nil && o.Cpu != nil { + if o != nil && o.Cpu.IsSet() { return true } return false } -// SetCpu gets a reference to the given NodeCpuResources and assigns it to the Cpu field. +// SetCpu gets a reference to the given NullableNodeCpuResources and assigns it to the Cpu field. func (o *NodeResources) SetCpu(v NodeCpuResources) { - o.Cpu = &v + o.Cpu.Set(&v) +} +// SetCpuNil sets the value for Cpu to be an explicit nil +func (o *NodeResources) SetCpuNil() { + o.Cpu.Set(nil) +} + +// UnsetCpu ensures that no value is present for Cpu, not even an explicit nil +func (o *NodeResources) UnsetCpu() { + o.Cpu.Unset() } // GetDevices returns the Devices field value if set, zero value otherwise. @@ -81,12 +91,12 @@ func (o *NodeResources) GetDevices() []NodeDeviceResource { var ret []NodeDeviceResource return ret } - return *o.Devices + return o.Devices } // GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeResources) GetDevicesOk() (*[]NodeDeviceResource, bool) { +func (o *NodeResources) GetDevicesOk() ([]NodeDeviceResource, bool) { if o == nil || o.Devices == nil { return nil, false } @@ -104,39 +114,49 @@ func (o *NodeResources) HasDevices() bool { // SetDevices gets a reference to the given []NodeDeviceResource and assigns it to the Devices field. func (o *NodeResources) SetDevices(v []NodeDeviceResource) { - o.Devices = &v + o.Devices = v } -// GetDisk returns the Disk field value if set, zero value otherwise. +// GetDisk returns the Disk field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeResources) GetDisk() NodeDiskResources { - if o == nil || o.Disk == nil { + if o == nil || o.Disk.Get() == nil { var ret NodeDiskResources return ret } - return *o.Disk + return *o.Disk.Get() } // GetDiskOk returns a tuple with the Disk field value if set, nil otherwise // 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 *NodeResources) GetDiskOk() (*NodeDiskResources, bool) { - if o == nil || o.Disk == nil { + if o == nil { return nil, false } - return o.Disk, true + return o.Disk.Get(), o.Disk.IsSet() } // HasDisk returns a boolean if a field has been set. func (o *NodeResources) HasDisk() bool { - if o != nil && o.Disk != nil { + if o != nil && o.Disk.IsSet() { return true } return false } -// SetDisk gets a reference to the given NodeDiskResources and assigns it to the Disk field. +// SetDisk gets a reference to the given NullableNodeDiskResources and assigns it to the Disk field. func (o *NodeResources) SetDisk(v NodeDiskResources) { - o.Disk = &v + o.Disk.Set(&v) +} +// SetDiskNil sets the value for Disk to be an explicit nil +func (o *NodeResources) SetDiskNil() { + o.Disk.Set(nil) +} + +// UnsetDisk ensures that no value is present for Disk, not even an explicit nil +func (o *NodeResources) UnsetDisk() { + o.Disk.Unset() } // GetMaxDynamicPort returns the MaxDynamicPort field value if set, zero value otherwise. @@ -171,36 +191,46 @@ func (o *NodeResources) SetMaxDynamicPort(v int32) { o.MaxDynamicPort = &v } -// GetMemory returns the Memory field value if set, zero value otherwise. +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeResources) GetMemory() NodeMemoryResources { - if o == nil || o.Memory == nil { + if o == nil || o.Memory.Get() == nil { var ret NodeMemoryResources return ret } - return *o.Memory + return *o.Memory.Get() } // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise // 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 *NodeResources) GetMemoryOk() (*NodeMemoryResources, bool) { - if o == nil || o.Memory == nil { + if o == nil { return nil, false } - return o.Memory, true + return o.Memory.Get(), o.Memory.IsSet() } // HasMemory returns a boolean if a field has been set. func (o *NodeResources) HasMemory() bool { - if o != nil && o.Memory != nil { + if o != nil && o.Memory.IsSet() { return true } return false } -// SetMemory gets a reference to the given NodeMemoryResources and assigns it to the Memory field. +// SetMemory gets a reference to the given NullableNodeMemoryResources and assigns it to the Memory field. func (o *NodeResources) SetMemory(v NodeMemoryResources) { - o.Memory = &v + o.Memory.Set(&v) +} +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *NodeResources) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *NodeResources) UnsetMemory() { + o.Memory.Unset() } // GetMinDynamicPort returns the MinDynamicPort field value if set, zero value otherwise. @@ -241,12 +271,12 @@ func (o *NodeResources) GetNetworks() []NetworkResource { var ret []NetworkResource return ret } - return *o.Networks + return o.Networks } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeResources) GetNetworksOk() (*[]NetworkResource, bool) { +func (o *NodeResources) GetNetworksOk() ([]NetworkResource, bool) { if o == nil || o.Networks == nil { return nil, false } @@ -264,25 +294,25 @@ func (o *NodeResources) HasNetworks() bool { // SetNetworks gets a reference to the given []NetworkResource and assigns it to the Networks field. func (o *NodeResources) SetNetworks(v []NetworkResource) { - o.Networks = &v + o.Networks = v } func (o NodeResources) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Cpu != nil { - toSerialize["Cpu"] = o.Cpu + if o.Cpu.IsSet() { + toSerialize["Cpu"] = o.Cpu.Get() } if o.Devices != nil { toSerialize["Devices"] = o.Devices } - if o.Disk != nil { - toSerialize["Disk"] = o.Disk + if o.Disk.IsSet() { + toSerialize["Disk"] = o.Disk.Get() } if o.MaxDynamicPort != nil { toSerialize["MaxDynamicPort"] = o.MaxDynamicPort } - if o.Memory != nil { - toSerialize["Memory"] = o.Memory + if o.Memory.IsSet() { + toSerialize["Memory"] = o.Memory.Get() } if o.MinDynamicPort != nil { toSerialize["MinDynamicPort"] = o.MinDynamicPort diff --git a/clients/go/v1/model_node_score_meta.go b/clients/go/v1/model_node_score_meta.go index 83cd01c3..2e6c819c 100644 --- a/clients/go/v1/model_node_score_meta.go +++ b/clients/go/v1/model_node_score_meta.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_node_update_drain_request.go b/clients/go/v1/model_node_update_drain_request.go index cf656aa2..1a672d25 100644 --- a/clients/go/v1/model_node_update_drain_request.go +++ b/clients/go/v1/model_node_update_drain_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // NodeUpdateDrainRequest struct for NodeUpdateDrainRequest type NodeUpdateDrainRequest struct { - DrainSpec *DrainSpec `json:"DrainSpec,omitempty"` + DrainSpec NullableDrainSpec `json:"DrainSpec,omitempty"` MarkEligible *bool `json:"MarkEligible,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` NodeID *string `json:"NodeID,omitempty"` @@ -40,36 +40,46 @@ func NewNodeUpdateDrainRequestWithDefaults() *NodeUpdateDrainRequest { return &this } -// GetDrainSpec returns the DrainSpec field value if set, zero value otherwise. +// GetDrainSpec returns the DrainSpec field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeUpdateDrainRequest) GetDrainSpec() DrainSpec { - if o == nil || o.DrainSpec == nil { + if o == nil || o.DrainSpec.Get() == nil { var ret DrainSpec return ret } - return *o.DrainSpec + return *o.DrainSpec.Get() } // GetDrainSpecOk returns a tuple with the DrainSpec field value if set, nil otherwise // 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 *NodeUpdateDrainRequest) GetDrainSpecOk() (*DrainSpec, bool) { - if o == nil || o.DrainSpec == nil { + if o == nil { return nil, false } - return o.DrainSpec, true + return o.DrainSpec.Get(), o.DrainSpec.IsSet() } // HasDrainSpec returns a boolean if a field has been set. func (o *NodeUpdateDrainRequest) HasDrainSpec() bool { - if o != nil && o.DrainSpec != nil { + if o != nil && o.DrainSpec.IsSet() { return true } return false } -// SetDrainSpec gets a reference to the given DrainSpec and assigns it to the DrainSpec field. +// SetDrainSpec gets a reference to the given NullableDrainSpec and assigns it to the DrainSpec field. func (o *NodeUpdateDrainRequest) SetDrainSpec(v DrainSpec) { - o.DrainSpec = &v + o.DrainSpec.Set(&v) +} +// SetDrainSpecNil sets the value for DrainSpec to be an explicit nil +func (o *NodeUpdateDrainRequest) SetDrainSpecNil() { + o.DrainSpec.Set(nil) +} + +// UnsetDrainSpec ensures that no value is present for DrainSpec, not even an explicit nil +func (o *NodeUpdateDrainRequest) UnsetDrainSpec() { + o.DrainSpec.Unset() } // GetMarkEligible returns the MarkEligible field value if set, zero value otherwise. @@ -170,8 +180,8 @@ func (o *NodeUpdateDrainRequest) SetNodeID(v string) { func (o NodeUpdateDrainRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.DrainSpec != nil { - toSerialize["DrainSpec"] = o.DrainSpec + if o.DrainSpec.IsSet() { + toSerialize["DrainSpec"] = o.DrainSpec.Get() } if o.MarkEligible != nil { toSerialize["MarkEligible"] = o.MarkEligible diff --git a/clients/go/v1/model_node_update_eligibility_request.go b/clients/go/v1/model_node_update_eligibility_request.go index 7d16d57a..859c1273 100644 --- a/clients/go/v1/model_node_update_eligibility_request.go +++ b/clients/go/v1/model_node_update_eligibility_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_object_diff.go b/clients/go/v1/model_object_diff.go index c9028801..1936861e 100644 --- a/clients/go/v1/model_object_diff.go +++ b/clients/go/v1/model_object_diff.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,9 @@ import ( // ObjectDiff struct for ObjectDiff type ObjectDiff struct { - Fields *[]FieldDiff `json:"Fields,omitempty"` + Fields []FieldDiff `json:"Fields,omitempty"` Name *string `json:"Name,omitempty"` - Objects *[]ObjectDiff `json:"Objects,omitempty"` + Objects []ObjectDiff `json:"Objects,omitempty"` Type *string `json:"Type,omitempty"` } @@ -46,12 +46,12 @@ func (o *ObjectDiff) GetFields() []FieldDiff { var ret []FieldDiff return ret } - return *o.Fields + return o.Fields } // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObjectDiff) GetFieldsOk() (*[]FieldDiff, bool) { +func (o *ObjectDiff) GetFieldsOk() ([]FieldDiff, bool) { if o == nil || o.Fields == nil { return nil, false } @@ -69,7 +69,7 @@ func (o *ObjectDiff) HasFields() bool { // SetFields gets a reference to the given []FieldDiff and assigns it to the Fields field. func (o *ObjectDiff) SetFields(v []FieldDiff) { - o.Fields = &v + o.Fields = v } // GetName returns the Name field value if set, zero value otherwise. @@ -110,12 +110,12 @@ func (o *ObjectDiff) GetObjects() []ObjectDiff { var ret []ObjectDiff return ret } - return *o.Objects + return o.Objects } // GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObjectDiff) GetObjectsOk() (*[]ObjectDiff, bool) { +func (o *ObjectDiff) GetObjectsOk() ([]ObjectDiff, bool) { if o == nil || o.Objects == nil { return nil, false } @@ -133,7 +133,7 @@ func (o *ObjectDiff) HasObjects() bool { // SetObjects gets a reference to the given []ObjectDiff and assigns it to the Objects field. func (o *ObjectDiff) SetObjects(v []ObjectDiff) { - o.Objects = &v + o.Objects = v } // GetType returns the Type field value if set, zero value otherwise. diff --git a/clients/go/v1/model_one_time_token.go b/clients/go/v1/model_one_time_token.go index 54ace0f8..aaa9fe47 100644 --- a/clients/go/v1/model_one_time_token.go +++ b/clients/go/v1/model_one_time_token.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ import ( type OneTimeToken struct { AccessorID *string `json:"AccessorID,omitempty"` CreateIndex *int32 `json:"CreateIndex,omitempty"` - ExpiresAt *time.Time `json:"ExpiresAt,omitempty"` + ExpiresAt NullableTime `json:"ExpiresAt,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` OneTimeSecretID *string `json:"OneTimeSecretID,omitempty"` } @@ -106,36 +106,46 @@ func (o *OneTimeToken) SetCreateIndex(v int32) { o.CreateIndex = &v } -// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *OneTimeToken) GetExpiresAt() time.Time { - if o == nil || o.ExpiresAt == nil { + if o == nil || o.ExpiresAt.Get() == nil { var ret time.Time return ret } - return *o.ExpiresAt + return *o.ExpiresAt.Get() } // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // 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 *OneTimeToken) GetExpiresAtOk() (*time.Time, bool) { - if o == nil || o.ExpiresAt == nil { + if o == nil { return nil, false } - return o.ExpiresAt, true + return o.ExpiresAt.Get(), o.ExpiresAt.IsSet() } // HasExpiresAt returns a boolean if a field has been set. func (o *OneTimeToken) HasExpiresAt() bool { - if o != nil && o.ExpiresAt != nil { + if o != nil && o.ExpiresAt.IsSet() { return true } return false } -// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +// SetExpiresAt gets a reference to the given NullableTime and assigns it to the ExpiresAt field. func (o *OneTimeToken) SetExpiresAt(v time.Time) { - o.ExpiresAt = &v + o.ExpiresAt.Set(&v) +} +// SetExpiresAtNil sets the value for ExpiresAt to be an explicit nil +func (o *OneTimeToken) SetExpiresAtNil() { + o.ExpiresAt.Set(nil) +} + +// UnsetExpiresAt ensures that no value is present for ExpiresAt, not even an explicit nil +func (o *OneTimeToken) UnsetExpiresAt() { + o.ExpiresAt.Unset() } // GetModifyIndex returns the ModifyIndex field value if set, zero value otherwise. @@ -210,8 +220,8 @@ func (o OneTimeToken) MarshalJSON() ([]byte, error) { if o.CreateIndex != nil { toSerialize["CreateIndex"] = o.CreateIndex } - if o.ExpiresAt != nil { - toSerialize["ExpiresAt"] = o.ExpiresAt + if o.ExpiresAt.IsSet() { + toSerialize["ExpiresAt"] = o.ExpiresAt.Get() } if o.ModifyIndex != nil { toSerialize["ModifyIndex"] = o.ModifyIndex diff --git a/clients/go/v1/model_one_time_token_exchange_request.go b/clients/go/v1/model_one_time_token_exchange_request.go index 3740c41c..baad1b36 100644 --- a/clients/go/v1/model_one_time_token_exchange_request.go +++ b/clients/go/v1/model_one_time_token_exchange_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_operator_health_reply.go b/clients/go/v1/model_operator_health_reply.go index b10d11e4..9510868a 100644 --- a/clients/go/v1/model_operator_health_reply.go +++ b/clients/go/v1/model_operator_health_reply.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type OperatorHealthReply struct { FailureTolerance *int32 `json:"FailureTolerance,omitempty"` Healthy *bool `json:"Healthy,omitempty"` - Servers *[]ServerHealth `json:"Servers,omitempty"` + Servers []ServerHealth `json:"Servers,omitempty"` } // NewOperatorHealthReply instantiates a new OperatorHealthReply object @@ -109,12 +109,12 @@ func (o *OperatorHealthReply) GetServers() []ServerHealth { var ret []ServerHealth return ret } - return *o.Servers + return o.Servers } // GetServersOk returns a tuple with the Servers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OperatorHealthReply) GetServersOk() (*[]ServerHealth, bool) { +func (o *OperatorHealthReply) GetServersOk() ([]ServerHealth, bool) { if o == nil || o.Servers == nil { return nil, false } @@ -132,7 +132,7 @@ func (o *OperatorHealthReply) HasServers() bool { // SetServers gets a reference to the given []ServerHealth and assigns it to the Servers field. func (o *OperatorHealthReply) SetServers(v []ServerHealth) { - o.Servers = &v + o.Servers = v } func (o OperatorHealthReply) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_parameterized_job_config.go b/clients/go/v1/model_parameterized_job_config.go index 2aa7d1dc..9446f51f 100644 --- a/clients/go/v1/model_parameterized_job_config.go +++ b/clients/go/v1/model_parameterized_job_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,8 +17,8 @@ import ( // ParameterizedJobConfig struct for ParameterizedJobConfig type ParameterizedJobConfig struct { - MetaOptional *[]string `json:"MetaOptional,omitempty"` - MetaRequired *[]string `json:"MetaRequired,omitempty"` + MetaOptional []string `json:"MetaOptional,omitempty"` + MetaRequired []string `json:"MetaRequired,omitempty"` Payload *string `json:"Payload,omitempty"` } @@ -45,12 +45,12 @@ func (o *ParameterizedJobConfig) GetMetaOptional() []string { var ret []string return ret } - return *o.MetaOptional + return o.MetaOptional } // GetMetaOptionalOk returns a tuple with the MetaOptional field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParameterizedJobConfig) GetMetaOptionalOk() (*[]string, bool) { +func (o *ParameterizedJobConfig) GetMetaOptionalOk() ([]string, bool) { if o == nil || o.MetaOptional == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *ParameterizedJobConfig) HasMetaOptional() bool { // SetMetaOptional gets a reference to the given []string and assigns it to the MetaOptional field. func (o *ParameterizedJobConfig) SetMetaOptional(v []string) { - o.MetaOptional = &v + o.MetaOptional = v } // GetMetaRequired returns the MetaRequired field value if set, zero value otherwise. @@ -77,12 +77,12 @@ func (o *ParameterizedJobConfig) GetMetaRequired() []string { var ret []string return ret } - return *o.MetaRequired + return o.MetaRequired } // GetMetaRequiredOk returns a tuple with the MetaRequired field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParameterizedJobConfig) GetMetaRequiredOk() (*[]string, bool) { +func (o *ParameterizedJobConfig) GetMetaRequiredOk() ([]string, bool) { if o == nil || o.MetaRequired == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *ParameterizedJobConfig) HasMetaRequired() bool { // SetMetaRequired gets a reference to the given []string and assigns it to the MetaRequired field. func (o *ParameterizedJobConfig) SetMetaRequired(v []string) { - o.MetaRequired = &v + o.MetaRequired = v } // GetPayload returns the Payload field value if set, zero value otherwise. diff --git a/clients/go/v1/model_periodic_config.go b/clients/go/v1/model_periodic_config.go index 7c56e7a0..d53e163a 100644 --- a/clients/go/v1/model_periodic_config.go +++ b/clients/go/v1/model_periodic_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_periodic_force_response.go b/clients/go/v1/model_periodic_force_response.go index 81d3469f..31e71307 100644 --- a/clients/go/v1/model_periodic_force_response.go +++ b/clients/go/v1/model_periodic_force_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_plan_annotations.go b/clients/go/v1/model_plan_annotations.go index 019d3c46..3c32889c 100644 --- a/clients/go/v1/model_plan_annotations.go +++ b/clients/go/v1/model_plan_annotations.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // PlanAnnotations struct for PlanAnnotations type PlanAnnotations struct { DesiredTGUpdates *map[string]DesiredUpdates `json:"DesiredTGUpdates,omitempty"` - PreemptedAllocs *[]AllocationListStub `json:"PreemptedAllocs,omitempty"` + PreemptedAllocs []AllocationListStub `json:"PreemptedAllocs,omitempty"` } // NewPlanAnnotations instantiates a new PlanAnnotations object @@ -76,12 +76,12 @@ func (o *PlanAnnotations) GetPreemptedAllocs() []AllocationListStub { var ret []AllocationListStub return ret } - return *o.PreemptedAllocs + return o.PreemptedAllocs } // GetPreemptedAllocsOk returns a tuple with the PreemptedAllocs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PlanAnnotations) GetPreemptedAllocsOk() (*[]AllocationListStub, bool) { +func (o *PlanAnnotations) GetPreemptedAllocsOk() ([]AllocationListStub, bool) { if o == nil || o.PreemptedAllocs == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *PlanAnnotations) HasPreemptedAllocs() bool { // SetPreemptedAllocs gets a reference to the given []AllocationListStub and assigns it to the PreemptedAllocs field. func (o *PlanAnnotations) SetPreemptedAllocs(v []AllocationListStub) { - o.PreemptedAllocs = &v + o.PreemptedAllocs = v } func (o PlanAnnotations) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_point_value.go b/clients/go/v1/model_point_value.go index 4f55b9bb..ba56e4b0 100644 --- a/clients/go/v1/model_point_value.go +++ b/clients/go/v1/model_point_value.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // PointValue struct for PointValue type PointValue struct { Name *string `json:"Name,omitempty"` - Points *[]float32 `json:"Points,omitempty"` + Points []float32 `json:"Points,omitempty"` } // NewPointValue instantiates a new PointValue object @@ -76,12 +76,12 @@ func (o *PointValue) GetPoints() []float32 { var ret []float32 return ret } - return *o.Points + return o.Points } // GetPointsOk returns a tuple with the Points field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PointValue) GetPointsOk() (*[]float32, bool) { +func (o *PointValue) GetPointsOk() ([]float32, bool) { if o == nil || o.Points == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *PointValue) HasPoints() bool { // SetPoints gets a reference to the given []float32 and assigns it to the Points field. func (o *PointValue) SetPoints(v []float32) { - o.Points = &v + o.Points = v } func (o PointValue) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_port.go b/clients/go/v1/model_port.go index a5b43152..b8ebabc8 100644 --- a/clients/go/v1/model_port.go +++ b/clients/go/v1/model_port.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_port_mapping.go b/clients/go/v1/model_port_mapping.go index 0a639e78..4761cf75 100644 --- a/clients/go/v1/model_port_mapping.go +++ b/clients/go/v1/model_port_mapping.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_preemption_config.go b/clients/go/v1/model_preemption_config.go index a681d503..70c25bfe 100644 --- a/clients/go/v1/model_preemption_config.go +++ b/clients/go/v1/model_preemption_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_quota_limit.go b/clients/go/v1/model_quota_limit.go index 3c6649a8..d5091562 100644 --- a/clients/go/v1/model_quota_limit.go +++ b/clients/go/v1/model_quota_limit.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type QuotaLimit struct { Hash *string `json:"Hash,omitempty"` Region *string `json:"Region,omitempty"` - RegionLimit *Resources `json:"RegionLimit,omitempty"` + RegionLimit NullableResources `json:"RegionLimit,omitempty"` } // NewQuotaLimit instantiates a new QuotaLimit object @@ -103,36 +103,46 @@ func (o *QuotaLimit) SetRegion(v string) { o.Region = &v } -// GetRegionLimit returns the RegionLimit field value if set, zero value otherwise. +// GetRegionLimit returns the RegionLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *QuotaLimit) GetRegionLimit() Resources { - if o == nil || o.RegionLimit == nil { + if o == nil || o.RegionLimit.Get() == nil { var ret Resources return ret } - return *o.RegionLimit + return *o.RegionLimit.Get() } // GetRegionLimitOk returns a tuple with the RegionLimit field value if set, nil otherwise // 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 *QuotaLimit) GetRegionLimitOk() (*Resources, bool) { - if o == nil || o.RegionLimit == nil { + if o == nil { return nil, false } - return o.RegionLimit, true + return o.RegionLimit.Get(), o.RegionLimit.IsSet() } // HasRegionLimit returns a boolean if a field has been set. func (o *QuotaLimit) HasRegionLimit() bool { - if o != nil && o.RegionLimit != nil { + if o != nil && o.RegionLimit.IsSet() { return true } return false } -// SetRegionLimit gets a reference to the given Resources and assigns it to the RegionLimit field. +// SetRegionLimit gets a reference to the given NullableResources and assigns it to the RegionLimit field. func (o *QuotaLimit) SetRegionLimit(v Resources) { - o.RegionLimit = &v + o.RegionLimit.Set(&v) +} +// SetRegionLimitNil sets the value for RegionLimit to be an explicit nil +func (o *QuotaLimit) SetRegionLimitNil() { + o.RegionLimit.Set(nil) +} + +// UnsetRegionLimit ensures that no value is present for RegionLimit, not even an explicit nil +func (o *QuotaLimit) UnsetRegionLimit() { + o.RegionLimit.Unset() } func (o QuotaLimit) MarshalJSON() ([]byte, error) { @@ -143,8 +153,8 @@ func (o QuotaLimit) MarshalJSON() ([]byte, error) { if o.Region != nil { toSerialize["Region"] = o.Region } - if o.RegionLimit != nil { - toSerialize["RegionLimit"] = o.RegionLimit + if o.RegionLimit.IsSet() { + toSerialize["RegionLimit"] = o.RegionLimit.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_quota_spec.go b/clients/go/v1/model_quota_spec.go index 155e88d6..711accef 100644 --- a/clients/go/v1/model_quota_spec.go +++ b/clients/go/v1/model_quota_spec.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type QuotaSpec struct { CreateIndex *int32 `json:"CreateIndex,omitempty"` Description *string `json:"Description,omitempty"` - Limits *[]QuotaLimit `json:"Limits,omitempty"` + Limits []QuotaLimit `json:"Limits,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Name *string `json:"Name,omitempty"` } @@ -111,12 +111,12 @@ func (o *QuotaSpec) GetLimits() []QuotaLimit { var ret []QuotaLimit return ret } - return *o.Limits + return o.Limits } // GetLimitsOk returns a tuple with the Limits field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *QuotaSpec) GetLimitsOk() (*[]QuotaLimit, bool) { +func (o *QuotaSpec) GetLimitsOk() ([]QuotaLimit, bool) { if o == nil || o.Limits == nil { return nil, false } @@ -134,7 +134,7 @@ func (o *QuotaSpec) HasLimits() bool { // SetLimits gets a reference to the given []QuotaLimit and assigns it to the Limits field. func (o *QuotaSpec) SetLimits(v []QuotaLimit) { - o.Limits = &v + o.Limits = v } // GetModifyIndex returns the ModifyIndex field value if set, zero value otherwise. diff --git a/clients/go/v1/model_raft_configuration.go b/clients/go/v1/model_raft_configuration.go index fec2851f..36582512 100644 --- a/clients/go/v1/model_raft_configuration.go +++ b/clients/go/v1/model_raft_configuration.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // RaftConfiguration struct for RaftConfiguration type RaftConfiguration struct { Index *int32 `json:"Index,omitempty"` - Servers *[]RaftServer `json:"Servers,omitempty"` + Servers []RaftServer `json:"Servers,omitempty"` } // NewRaftConfiguration instantiates a new RaftConfiguration object @@ -76,12 +76,12 @@ func (o *RaftConfiguration) GetServers() []RaftServer { var ret []RaftServer return ret } - return *o.Servers + return o.Servers } // GetServersOk returns a tuple with the Servers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RaftConfiguration) GetServersOk() (*[]RaftServer, bool) { +func (o *RaftConfiguration) GetServersOk() ([]RaftServer, bool) { if o == nil || o.Servers == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *RaftConfiguration) HasServers() bool { // SetServers gets a reference to the given []RaftServer and assigns it to the Servers field. func (o *RaftConfiguration) SetServers(v []RaftServer) { - o.Servers = &v + o.Servers = v } func (o RaftConfiguration) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_raft_server.go b/clients/go/v1/model_raft_server.go index edc3e7c1..f201777d 100644 --- a/clients/go/v1/model_raft_server.go +++ b/clients/go/v1/model_raft_server.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_requested_device.go b/clients/go/v1/model_requested_device.go index 0f9a5f17..170bda95 100644 --- a/clients/go/v1/model_requested_device.go +++ b/clients/go/v1/model_requested_device.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,8 +17,8 @@ import ( // RequestedDevice struct for RequestedDevice type RequestedDevice struct { - Affinities *[]Affinity `json:"Affinities,omitempty"` - Constraints *[]Constraint `json:"Constraints,omitempty"` + Affinities []Affinity `json:"Affinities,omitempty"` + Constraints []Constraint `json:"Constraints,omitempty"` Count *int32 `json:"Count,omitempty"` Name *string `json:"Name,omitempty"` } @@ -46,12 +46,12 @@ func (o *RequestedDevice) GetAffinities() []Affinity { var ret []Affinity return ret } - return *o.Affinities + return o.Affinities } // GetAffinitiesOk returns a tuple with the Affinities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RequestedDevice) GetAffinitiesOk() (*[]Affinity, bool) { +func (o *RequestedDevice) GetAffinitiesOk() ([]Affinity, bool) { if o == nil || o.Affinities == nil { return nil, false } @@ -69,7 +69,7 @@ func (o *RequestedDevice) HasAffinities() bool { // SetAffinities gets a reference to the given []Affinity and assigns it to the Affinities field. func (o *RequestedDevice) SetAffinities(v []Affinity) { - o.Affinities = &v + o.Affinities = v } // GetConstraints returns the Constraints field value if set, zero value otherwise. @@ -78,12 +78,12 @@ func (o *RequestedDevice) GetConstraints() []Constraint { var ret []Constraint return ret } - return *o.Constraints + return o.Constraints } // GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RequestedDevice) GetConstraintsOk() (*[]Constraint, bool) { +func (o *RequestedDevice) GetConstraintsOk() ([]Constraint, bool) { if o == nil || o.Constraints == nil { return nil, false } @@ -101,7 +101,7 @@ func (o *RequestedDevice) HasConstraints() bool { // SetConstraints gets a reference to the given []Constraint and assigns it to the Constraints field. func (o *RequestedDevice) SetConstraints(v []Constraint) { - o.Constraints = &v + o.Constraints = v } // GetCount returns the Count field value if set, zero value otherwise. diff --git a/clients/go/v1/model_reschedule_event.go b/clients/go/v1/model_reschedule_event.go index 75c30a16..b0176829 100644 --- a/clients/go/v1/model_reschedule_event.go +++ b/clients/go/v1/model_reschedule_event.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_reschedule_policy.go b/clients/go/v1/model_reschedule_policy.go index 7c4d8f94..bc9ce7ea 100644 --- a/clients/go/v1/model_reschedule_policy.go +++ b/clients/go/v1/model_reschedule_policy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_reschedule_tracker.go b/clients/go/v1/model_reschedule_tracker.go index b041b204..22e54f68 100644 --- a/clients/go/v1/model_reschedule_tracker.go +++ b/clients/go/v1/model_reschedule_tracker.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // RescheduleTracker struct for RescheduleTracker type RescheduleTracker struct { - Events *[]RescheduleEvent `json:"Events,omitempty"` + Events []RescheduleEvent `json:"Events,omitempty"` } // NewRescheduleTracker instantiates a new RescheduleTracker object @@ -43,12 +43,12 @@ func (o *RescheduleTracker) GetEvents() []RescheduleEvent { var ret []RescheduleEvent return ret } - return *o.Events + return o.Events } // GetEventsOk returns a tuple with the Events field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RescheduleTracker) GetEventsOk() (*[]RescheduleEvent, bool) { +func (o *RescheduleTracker) GetEventsOk() ([]RescheduleEvent, bool) { if o == nil || o.Events == nil { return nil, false } @@ -66,7 +66,7 @@ func (o *RescheduleTracker) HasEvents() bool { // SetEvents gets a reference to the given []RescheduleEvent and assigns it to the Events field. func (o *RescheduleTracker) SetEvents(v []RescheduleEvent) { - o.Events = &v + o.Events = v } func (o RescheduleTracker) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_resources.go b/clients/go/v1/model_resources.go index 7fd2ca03..39f51ab5 100644 --- a/clients/go/v1/model_resources.go +++ b/clients/go/v1/model_resources.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,12 +19,12 @@ import ( type Resources struct { CPU *int32 `json:"CPU,omitempty"` Cores *int32 `json:"Cores,omitempty"` - Devices *[]RequestedDevice `json:"Devices,omitempty"` + Devices []RequestedDevice `json:"Devices,omitempty"` DiskMB *int32 `json:"DiskMB,omitempty"` IOPS *int32 `json:"IOPS,omitempty"` MemoryMB *int32 `json:"MemoryMB,omitempty"` MemoryMaxMB *int32 `json:"MemoryMaxMB,omitempty"` - Networks *[]NetworkResource `json:"Networks,omitempty"` + Networks []NetworkResource `json:"Networks,omitempty"` } // NewResources instantiates a new Resources object @@ -114,12 +114,12 @@ func (o *Resources) GetDevices() []RequestedDevice { var ret []RequestedDevice return ret } - return *o.Devices + return o.Devices } // GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Resources) GetDevicesOk() (*[]RequestedDevice, bool) { +func (o *Resources) GetDevicesOk() ([]RequestedDevice, bool) { if o == nil || o.Devices == nil { return nil, false } @@ -137,7 +137,7 @@ func (o *Resources) HasDevices() bool { // SetDevices gets a reference to the given []RequestedDevice and assigns it to the Devices field. func (o *Resources) SetDevices(v []RequestedDevice) { - o.Devices = &v + o.Devices = v } // GetDiskMB returns the DiskMB field value if set, zero value otherwise. @@ -274,12 +274,12 @@ func (o *Resources) GetNetworks() []NetworkResource { var ret []NetworkResource return ret } - return *o.Networks + return o.Networks } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Resources) GetNetworksOk() (*[]NetworkResource, bool) { +func (o *Resources) GetNetworksOk() ([]NetworkResource, bool) { if o == nil || o.Networks == nil { return nil, false } @@ -297,7 +297,7 @@ func (o *Resources) HasNetworks() bool { // SetNetworks gets a reference to the given []NetworkResource and assigns it to the Networks field. func (o *Resources) SetNetworks(v []NetworkResource) { - o.Networks = &v + o.Networks = v } func (o Resources) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_restart_policy.go b/clients/go/v1/model_restart_policy.go index 0e422753..d6233523 100644 --- a/clients/go/v1/model_restart_policy.go +++ b/clients/go/v1/model_restart_policy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_sampled_value.go b/clients/go/v1/model_sampled_value.go index cd637e6c..83ed70ae 100644 --- a/clients/go/v1/model_sampled_value.go +++ b/clients/go/v1/model_sampled_value.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_scaling_event.go b/clients/go/v1/model_scaling_event.go index aa16f92e..ad737ac9 100644 --- a/clients/go/v1/model_scaling_event.go +++ b/clients/go/v1/model_scaling_event.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type ScalingEvent struct { Error *bool `json:"Error,omitempty"` EvalID *string `json:"EvalID,omitempty"` Message *string `json:"Message,omitempty"` - Meta *map[string]interface{} `json:"Meta,omitempty"` + Meta map[string]interface{} `json:"Meta,omitempty"` PreviousCount *int64 `json:"PreviousCount,omitempty"` Time *int32 `json:"Time,omitempty"` } @@ -210,12 +210,12 @@ func (o *ScalingEvent) GetMeta() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Meta + return o.Meta } // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScalingEvent) GetMetaOk() (*map[string]interface{}, bool) { +func (o *ScalingEvent) GetMetaOk() (map[string]interface{}, bool) { if o == nil || o.Meta == nil { return nil, false } @@ -233,7 +233,7 @@ func (o *ScalingEvent) HasMeta() bool { // SetMeta gets a reference to the given map[string]interface{} and assigns it to the Meta field. func (o *ScalingEvent) SetMeta(v map[string]interface{}) { - o.Meta = &v + o.Meta = v } // GetPreviousCount returns the PreviousCount field value if set, zero value otherwise. diff --git a/clients/go/v1/model_scaling_policy.go b/clients/go/v1/model_scaling_policy.go index ddddac2d..f82b4a32 100644 --- a/clients/go/v1/model_scaling_policy.go +++ b/clients/go/v1/model_scaling_policy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,7 +24,7 @@ type ScalingPolicy struct { Min *int64 `json:"Min,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` Namespace *string `json:"Namespace,omitempty"` - Policy *map[string]interface{} `json:"Policy,omitempty"` + Policy map[string]interface{} `json:"Policy,omitempty"` Target *map[string]string `json:"Target,omitempty"` Type *string `json:"Type,omitempty"` } @@ -276,12 +276,12 @@ func (o *ScalingPolicy) GetPolicy() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Policy + return o.Policy } // GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScalingPolicy) GetPolicyOk() (*map[string]interface{}, bool) { +func (o *ScalingPolicy) GetPolicyOk() (map[string]interface{}, bool) { if o == nil || o.Policy == nil { return nil, false } @@ -299,7 +299,7 @@ func (o *ScalingPolicy) HasPolicy() bool { // SetPolicy gets a reference to the given map[string]interface{} and assigns it to the Policy field. func (o *ScalingPolicy) SetPolicy(v map[string]interface{}) { - o.Policy = &v + o.Policy = v } // GetTarget returns the Target field value if set, zero value otherwise. diff --git a/clients/go/v1/model_scaling_policy_list_stub.go b/clients/go/v1/model_scaling_policy_list_stub.go index e709005b..b6c0c430 100644 --- a/clients/go/v1/model_scaling_policy_list_stub.go +++ b/clients/go/v1/model_scaling_policy_list_stub.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_scaling_request.go b/clients/go/v1/model_scaling_request.go index 9d2755db..09d78949 100644 --- a/clients/go/v1/model_scaling_request.go +++ b/clients/go/v1/model_scaling_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ type ScalingRequest struct { Count *int64 `json:"Count,omitempty"` Error *bool `json:"Error,omitempty"` Message *string `json:"Message,omitempty"` - Meta *map[string]interface{} `json:"Meta,omitempty"` + Meta map[string]interface{} `json:"Meta,omitempty"` Namespace *string `json:"Namespace,omitempty"` PolicyOverride *bool `json:"PolicyOverride,omitempty"` Region *string `json:"Region,omitempty"` @@ -147,12 +147,12 @@ func (o *ScalingRequest) GetMeta() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Meta + return o.Meta } // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScalingRequest) GetMetaOk() (*map[string]interface{}, bool) { +func (o *ScalingRequest) GetMetaOk() (map[string]interface{}, bool) { if o == nil || o.Meta == nil { return nil, false } @@ -170,7 +170,7 @@ func (o *ScalingRequest) HasMeta() bool { // SetMeta gets a reference to the given map[string]interface{} and assigns it to the Meta field. func (o *ScalingRequest) SetMeta(v map[string]interface{}) { - o.Meta = &v + o.Meta = v } // GetNamespace returns the Namespace field value if set, zero value otherwise. diff --git a/clients/go/v1/model_scheduler_configuration.go b/clients/go/v1/model_scheduler_configuration.go index e2622aa7..a0419d98 100644 --- a/clients/go/v1/model_scheduler_configuration.go +++ b/clients/go/v1/model_scheduler_configuration.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,7 +21,7 @@ type SchedulerConfiguration struct { MemoryOversubscriptionEnabled *bool `json:"MemoryOversubscriptionEnabled,omitempty"` ModifyIndex *int32 `json:"ModifyIndex,omitempty"` PauseEvalBroker *bool `json:"PauseEvalBroker,omitempty"` - PreemptionConfig *PreemptionConfig `json:"PreemptionConfig,omitempty"` + PreemptionConfig NullablePreemptionConfig `json:"PreemptionConfig,omitempty"` RejectJobRegistration *bool `json:"RejectJobRegistration,omitempty"` SchedulerAlgorithm *string `json:"SchedulerAlgorithm,omitempty"` } @@ -139,68 +139,46 @@ func (o *SchedulerConfiguration) SetModifyIndex(v int32) { o.ModifyIndex = &v } -// GetPauseEvalBroker returns the PauseEvalBroker field value if set, zero value otherwise. -func (o *SchedulerConfiguration) GetPauseEvalBroker() bool { - if o == nil || o.PauseEvalBroker == nil { - var ret bool - return ret - } - return *o.PauseEvalBroker -} - -// GetPauseEvalBrokerOk returns a tuple with the PauseEvalBroker field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SchedulerConfiguration) GetPauseEvalBrokerOk() (*bool, bool) { - if o == nil || o.PauseEvalBroker == nil { - return nil, false - } - return o.PauseEvalBroker, true -} - -// HasPauseEvalBroker returns a boolean if a field has been set. -func (o *SchedulerConfiguration) HasPauseEvalBroker() bool { - if o != nil && o.PauseEvalBroker != nil { - return true - } - - return false -} - -// SetPauseEvalBroker gets a reference to the given bool and assigns it to the PauseEvalBroker field. -func (o *SchedulerConfiguration) SetPauseEvalBroker(v bool) { - o.PauseEvalBroker = &v -} - -// GetPreemptionConfig returns the PreemptionConfig field value if set, zero value otherwise. +// GetPreemptionConfig returns the PreemptionConfig field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SchedulerConfiguration) GetPreemptionConfig() PreemptionConfig { - if o == nil || o.PreemptionConfig == nil { + if o == nil || o.PreemptionConfig.Get() == nil { var ret PreemptionConfig return ret } - return *o.PreemptionConfig + return *o.PreemptionConfig.Get() } // GetPreemptionConfigOk returns a tuple with the PreemptionConfig field value if set, nil otherwise // 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 *SchedulerConfiguration) GetPreemptionConfigOk() (*PreemptionConfig, bool) { - if o == nil || o.PreemptionConfig == nil { + if o == nil { return nil, false } - return o.PreemptionConfig, true + return o.PreemptionConfig.Get(), o.PreemptionConfig.IsSet() } // HasPreemptionConfig returns a boolean if a field has been set. func (o *SchedulerConfiguration) HasPreemptionConfig() bool { - if o != nil && o.PreemptionConfig != nil { + if o != nil && o.PreemptionConfig.IsSet() { return true } return false } -// SetPreemptionConfig gets a reference to the given PreemptionConfig and assigns it to the PreemptionConfig field. +// SetPreemptionConfig gets a reference to the given NullablePreemptionConfig and assigns it to the PreemptionConfig field. func (o *SchedulerConfiguration) SetPreemptionConfig(v PreemptionConfig) { - o.PreemptionConfig = &v + o.PreemptionConfig.Set(&v) +} +// SetPreemptionConfigNil sets the value for PreemptionConfig to be an explicit nil +func (o *SchedulerConfiguration) SetPreemptionConfigNil() { + o.PreemptionConfig.Set(nil) +} + +// UnsetPreemptionConfig ensures that no value is present for PreemptionConfig, not even an explicit nil +func (o *SchedulerConfiguration) UnsetPreemptionConfig() { + o.PreemptionConfig.Unset() } // GetRejectJobRegistration returns the RejectJobRegistration field value if set, zero value otherwise. @@ -281,8 +259,8 @@ func (o SchedulerConfiguration) MarshalJSON() ([]byte, error) { if o.PauseEvalBroker != nil { toSerialize["PauseEvalBroker"] = o.PauseEvalBroker } - if o.PreemptionConfig != nil { - toSerialize["PreemptionConfig"] = o.PreemptionConfig + if o.PreemptionConfig.IsSet() { + toSerialize["PreemptionConfig"] = o.PreemptionConfig.Get() } if o.RejectJobRegistration != nil { toSerialize["RejectJobRegistration"] = o.RejectJobRegistration diff --git a/clients/go/v1/model_scheduler_configuration_response.go b/clients/go/v1/model_scheduler_configuration_response.go index 5590a39b..e14af240 100644 --- a/clients/go/v1/model_scheduler_configuration_response.go +++ b/clients/go/v1/model_scheduler_configuration_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,7 @@ type SchedulerConfigurationResponse struct { LastIndex *int32 `json:"LastIndex,omitempty"` NextToken *string `json:"NextToken,omitempty"` RequestTime *int64 `json:"RequestTime,omitempty"` - SchedulerConfig *SchedulerConfiguration `json:"SchedulerConfig,omitempty"` + SchedulerConfig NullableSchedulerConfiguration `json:"SchedulerConfig,omitempty"` } // NewSchedulerConfigurationResponse instantiates a new SchedulerConfigurationResponse object @@ -202,36 +202,46 @@ func (o *SchedulerConfigurationResponse) SetRequestTime(v int64) { o.RequestTime = &v } -// GetSchedulerConfig returns the SchedulerConfig field value if set, zero value otherwise. +// GetSchedulerConfig returns the SchedulerConfig field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SchedulerConfigurationResponse) GetSchedulerConfig() SchedulerConfiguration { - if o == nil || o.SchedulerConfig == nil { + if o == nil || o.SchedulerConfig.Get() == nil { var ret SchedulerConfiguration return ret } - return *o.SchedulerConfig + return *o.SchedulerConfig.Get() } // GetSchedulerConfigOk returns a tuple with the SchedulerConfig field value if set, nil otherwise // 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 *SchedulerConfigurationResponse) GetSchedulerConfigOk() (*SchedulerConfiguration, bool) { - if o == nil || o.SchedulerConfig == nil { + if o == nil { return nil, false } - return o.SchedulerConfig, true + return o.SchedulerConfig.Get(), o.SchedulerConfig.IsSet() } // HasSchedulerConfig returns a boolean if a field has been set. func (o *SchedulerConfigurationResponse) HasSchedulerConfig() bool { - if o != nil && o.SchedulerConfig != nil { + if o != nil && o.SchedulerConfig.IsSet() { return true } return false } -// SetSchedulerConfig gets a reference to the given SchedulerConfiguration and assigns it to the SchedulerConfig field. +// SetSchedulerConfig gets a reference to the given NullableSchedulerConfiguration and assigns it to the SchedulerConfig field. func (o *SchedulerConfigurationResponse) SetSchedulerConfig(v SchedulerConfiguration) { - o.SchedulerConfig = &v + o.SchedulerConfig.Set(&v) +} +// SetSchedulerConfigNil sets the value for SchedulerConfig to be an explicit nil +func (o *SchedulerConfigurationResponse) SetSchedulerConfigNil() { + o.SchedulerConfig.Set(nil) +} + +// UnsetSchedulerConfig ensures that no value is present for SchedulerConfig, not even an explicit nil +func (o *SchedulerConfigurationResponse) UnsetSchedulerConfig() { + o.SchedulerConfig.Unset() } func (o SchedulerConfigurationResponse) MarshalJSON() ([]byte, error) { @@ -251,8 +261,8 @@ func (o SchedulerConfigurationResponse) MarshalJSON() ([]byte, error) { if o.RequestTime != nil { toSerialize["RequestTime"] = o.RequestTime } - if o.SchedulerConfig != nil { - toSerialize["SchedulerConfig"] = o.SchedulerConfig + if o.SchedulerConfig.IsSet() { + toSerialize["SchedulerConfig"] = o.SchedulerConfig.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_scheduler_set_configuration_response.go b/clients/go/v1/model_scheduler_set_configuration_response.go index 6b654a78..7d0479b6 100644 --- a/clients/go/v1/model_scheduler_set_configuration_response.go +++ b/clients/go/v1/model_scheduler_set_configuration_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_search_request.go b/clients/go/v1/model_search_request.go index 76ee71aa..852e49b3 100644 --- a/clients/go/v1/model_search_request.go +++ b/clients/go/v1/model_search_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_search_response.go b/clients/go/v1/model_search_response.go index fb6ef2f8..1a02ffa2 100644 --- a/clients/go/v1/model_search_response.go +++ b/clients/go/v1/model_search_response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_server_health.go b/clients/go/v1/model_server_health.go index 8b9c0d7e..e15321b4 100644 --- a/clients/go/v1/model_server_health.go +++ b/clients/go/v1/model_server_health.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -27,7 +27,7 @@ type ServerHealth struct { Leader *bool `json:"Leader,omitempty"` Name *string `json:"Name,omitempty"` SerfStatus *string `json:"SerfStatus,omitempty"` - StableSince *time.Time `json:"StableSince,omitempty"` + StableSince NullableTime `json:"StableSince,omitempty"` Version *string `json:"Version,omitempty"` Voter *bool `json:"Voter,omitempty"` } @@ -337,36 +337,46 @@ func (o *ServerHealth) SetSerfStatus(v string) { o.SerfStatus = &v } -// GetStableSince returns the StableSince field value if set, zero value otherwise. +// GetStableSince returns the StableSince field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ServerHealth) GetStableSince() time.Time { - if o == nil || o.StableSince == nil { + if o == nil || o.StableSince.Get() == nil { var ret time.Time return ret } - return *o.StableSince + return *o.StableSince.Get() } // GetStableSinceOk returns a tuple with the StableSince field value if set, nil otherwise // 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 *ServerHealth) GetStableSinceOk() (*time.Time, bool) { - if o == nil || o.StableSince == nil { + if o == nil { return nil, false } - return o.StableSince, true + return o.StableSince.Get(), o.StableSince.IsSet() } // HasStableSince returns a boolean if a field has been set. func (o *ServerHealth) HasStableSince() bool { - if o != nil && o.StableSince != nil { + if o != nil && o.StableSince.IsSet() { return true } return false } -// SetStableSince gets a reference to the given time.Time and assigns it to the StableSince field. +// SetStableSince gets a reference to the given NullableTime and assigns it to the StableSince field. func (o *ServerHealth) SetStableSince(v time.Time) { - o.StableSince = &v + o.StableSince.Set(&v) +} +// SetStableSinceNil sets the value for StableSince to be an explicit nil +func (o *ServerHealth) SetStableSinceNil() { + o.StableSince.Set(nil) +} + +// UnsetStableSince ensures that no value is present for StableSince, not even an explicit nil +func (o *ServerHealth) UnsetStableSince() { + o.StableSince.Unset() } // GetVersion returns the Version field value if set, zero value otherwise. @@ -462,8 +472,8 @@ func (o ServerHealth) MarshalJSON() ([]byte, error) { if o.SerfStatus != nil { toSerialize["SerfStatus"] = o.SerfStatus } - if o.StableSince != nil { - toSerialize["StableSince"] = o.StableSince + if o.StableSince.IsSet() { + toSerialize["StableSince"] = o.StableSince.Get() } if o.Version != nil { toSerialize["Version"] = o.Version diff --git a/clients/go/v1/model_service.go b/clients/go/v1/model_service.go index 556b457f..28a00986 100644 --- a/clients/go/v1/model_service.go +++ b/clients/go/v1/model_service.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,10 +20,10 @@ type Service struct { Address *string `json:"Address,omitempty"` AddressMode *string `json:"AddressMode,omitempty"` CanaryMeta *map[string]string `json:"CanaryMeta,omitempty"` - CanaryTags *[]string `json:"CanaryTags,omitempty"` - CheckRestart *CheckRestart `json:"CheckRestart,omitempty"` - Checks *[]ServiceCheck `json:"Checks,omitempty"` - Connect *ConsulConnect `json:"Connect,omitempty"` + CanaryTags []string `json:"CanaryTags,omitempty"` + CheckRestart NullableCheckRestart `json:"CheckRestart,omitempty"` + Checks []ServiceCheck `json:"Checks,omitempty"` + Connect NullableConsulConnect `json:"Connect,omitempty"` EnableTagOverride *bool `json:"EnableTagOverride,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` Name *string `json:"Name,omitempty"` @@ -31,7 +31,7 @@ type Service struct { PortLabel *string `json:"PortLabel,omitempty"` Provider *string `json:"Provider,omitempty"` TaggedAddresses *map[string]string `json:"TaggedAddresses,omitempty"` - Tags *[]string `json:"Tags,omitempty"` + Tags []string `json:"Tags,omitempty"` TaskName *string `json:"TaskName,omitempty"` } @@ -154,12 +154,12 @@ func (o *Service) GetCanaryTags() []string { var ret []string return ret } - return *o.CanaryTags + return o.CanaryTags } // GetCanaryTagsOk returns a tuple with the CanaryTags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Service) GetCanaryTagsOk() (*[]string, bool) { +func (o *Service) GetCanaryTagsOk() ([]string, bool) { if o == nil || o.CanaryTags == nil { return nil, false } @@ -177,39 +177,49 @@ func (o *Service) HasCanaryTags() bool { // SetCanaryTags gets a reference to the given []string and assigns it to the CanaryTags field. func (o *Service) SetCanaryTags(v []string) { - o.CanaryTags = &v + o.CanaryTags = v } -// GetCheckRestart returns the CheckRestart field value if set, zero value otherwise. +// GetCheckRestart returns the CheckRestart field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Service) GetCheckRestart() CheckRestart { - if o == nil || o.CheckRestart == nil { + if o == nil || o.CheckRestart.Get() == nil { var ret CheckRestart return ret } - return *o.CheckRestart + return *o.CheckRestart.Get() } // GetCheckRestartOk returns a tuple with the CheckRestart field value if set, nil otherwise // 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 *Service) GetCheckRestartOk() (*CheckRestart, bool) { - if o == nil || o.CheckRestart == nil { + if o == nil { return nil, false } - return o.CheckRestart, true + return o.CheckRestart.Get(), o.CheckRestart.IsSet() } // HasCheckRestart returns a boolean if a field has been set. func (o *Service) HasCheckRestart() bool { - if o != nil && o.CheckRestart != nil { + if o != nil && o.CheckRestart.IsSet() { return true } return false } -// SetCheckRestart gets a reference to the given CheckRestart and assigns it to the CheckRestart field. +// SetCheckRestart gets a reference to the given NullableCheckRestart and assigns it to the CheckRestart field. func (o *Service) SetCheckRestart(v CheckRestart) { - o.CheckRestart = &v + o.CheckRestart.Set(&v) +} +// SetCheckRestartNil sets the value for CheckRestart to be an explicit nil +func (o *Service) SetCheckRestartNil() { + o.CheckRestart.Set(nil) +} + +// UnsetCheckRestart ensures that no value is present for CheckRestart, not even an explicit nil +func (o *Service) UnsetCheckRestart() { + o.CheckRestart.Unset() } // GetChecks returns the Checks field value if set, zero value otherwise. @@ -218,12 +228,12 @@ func (o *Service) GetChecks() []ServiceCheck { var ret []ServiceCheck return ret } - return *o.Checks + return o.Checks } // GetChecksOk returns a tuple with the Checks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Service) GetChecksOk() (*[]ServiceCheck, bool) { +func (o *Service) GetChecksOk() ([]ServiceCheck, bool) { if o == nil || o.Checks == nil { return nil, false } @@ -241,39 +251,49 @@ func (o *Service) HasChecks() bool { // SetChecks gets a reference to the given []ServiceCheck and assigns it to the Checks field. func (o *Service) SetChecks(v []ServiceCheck) { - o.Checks = &v + o.Checks = v } -// GetConnect returns the Connect field value if set, zero value otherwise. +// GetConnect returns the Connect field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Service) GetConnect() ConsulConnect { - if o == nil || o.Connect == nil { + if o == nil || o.Connect.Get() == nil { var ret ConsulConnect return ret } - return *o.Connect + return *o.Connect.Get() } // GetConnectOk returns a tuple with the Connect field value if set, nil otherwise // 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 *Service) GetConnectOk() (*ConsulConnect, bool) { - if o == nil || o.Connect == nil { + if o == nil { return nil, false } - return o.Connect, true + return o.Connect.Get(), o.Connect.IsSet() } // HasConnect returns a boolean if a field has been set. func (o *Service) HasConnect() bool { - if o != nil && o.Connect != nil { + if o != nil && o.Connect.IsSet() { return true } return false } -// SetConnect gets a reference to the given ConsulConnect and assigns it to the Connect field. +// SetConnect gets a reference to the given NullableConsulConnect and assigns it to the Connect field. func (o *Service) SetConnect(v ConsulConnect) { - o.Connect = &v + o.Connect.Set(&v) +} +// SetConnectNil sets the value for Connect to be an explicit nil +func (o *Service) SetConnectNil() { + o.Connect.Set(nil) +} + +// UnsetConnect ensures that no value is present for Connect, not even an explicit nil +func (o *Service) UnsetConnect() { + o.Connect.Unset() } // GetEnableTagOverride returns the EnableTagOverride field value if set, zero value otherwise. @@ -506,12 +526,12 @@ func (o *Service) GetTags() []string { var ret []string return ret } - return *o.Tags + return o.Tags } // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Service) GetTagsOk() (*[]string, bool) { +func (o *Service) GetTagsOk() ([]string, bool) { if o == nil || o.Tags == nil { return nil, false } @@ -529,7 +549,7 @@ func (o *Service) HasTags() bool { // SetTags gets a reference to the given []string and assigns it to the Tags field. func (o *Service) SetTags(v []string) { - o.Tags = &v + o.Tags = v } // GetTaskName returns the TaskName field value if set, zero value otherwise. @@ -578,14 +598,14 @@ func (o Service) MarshalJSON() ([]byte, error) { if o.CanaryTags != nil { toSerialize["CanaryTags"] = o.CanaryTags } - if o.CheckRestart != nil { - toSerialize["CheckRestart"] = o.CheckRestart + if o.CheckRestart.IsSet() { + toSerialize["CheckRestart"] = o.CheckRestart.Get() } if o.Checks != nil { toSerialize["Checks"] = o.Checks } - if o.Connect != nil { - toSerialize["Connect"] = o.Connect + if o.Connect.IsSet() { + toSerialize["Connect"] = o.Connect.Get() } if o.EnableTagOverride != nil { toSerialize["EnableTagOverride"] = o.EnableTagOverride diff --git a/clients/go/v1/model_service_check.go b/clients/go/v1/model_service_check.go index 0d562a29..afa53da8 100644 --- a/clients/go/v1/model_service_check.go +++ b/clients/go/v1/model_service_check.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,9 @@ import ( type ServiceCheck struct { AddressMode *string `json:"AddressMode,omitempty"` Advertise *string `json:"Advertise,omitempty"` - Args *[]string `json:"Args,omitempty"` + Args []string `json:"Args,omitempty"` Body *string `json:"Body,omitempty"` - CheckRestart *CheckRestart `json:"CheckRestart,omitempty"` + CheckRestart NullableCheckRestart `json:"CheckRestart,omitempty"` Command *string `json:"Command,omitempty"` Expose *bool `json:"Expose,omitempty"` FailuresBeforeCritical *int32 `json:"FailuresBeforeCritical,omitempty"` @@ -130,12 +130,12 @@ func (o *ServiceCheck) GetArgs() []string { var ret []string return ret } - return *o.Args + return o.Args } // GetArgsOk returns a tuple with the Args field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceCheck) GetArgsOk() (*[]string, bool) { +func (o *ServiceCheck) GetArgsOk() ([]string, bool) { if o == nil || o.Args == nil { return nil, false } @@ -153,7 +153,7 @@ func (o *ServiceCheck) HasArgs() bool { // SetArgs gets a reference to the given []string and assigns it to the Args field. func (o *ServiceCheck) SetArgs(v []string) { - o.Args = &v + o.Args = v } // GetBody returns the Body field value if set, zero value otherwise. @@ -188,36 +188,46 @@ func (o *ServiceCheck) SetBody(v string) { o.Body = &v } -// GetCheckRestart returns the CheckRestart field value if set, zero value otherwise. +// GetCheckRestart returns the CheckRestart field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ServiceCheck) GetCheckRestart() CheckRestart { - if o == nil || o.CheckRestart == nil { + if o == nil || o.CheckRestart.Get() == nil { var ret CheckRestart return ret } - return *o.CheckRestart + return *o.CheckRestart.Get() } // GetCheckRestartOk returns a tuple with the CheckRestart field value if set, nil otherwise // 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 *ServiceCheck) GetCheckRestartOk() (*CheckRestart, bool) { - if o == nil || o.CheckRestart == nil { + if o == nil { return nil, false } - return o.CheckRestart, true + return o.CheckRestart.Get(), o.CheckRestart.IsSet() } // HasCheckRestart returns a boolean if a field has been set. func (o *ServiceCheck) HasCheckRestart() bool { - if o != nil && o.CheckRestart != nil { + if o != nil && o.CheckRestart.IsSet() { return true } return false } -// SetCheckRestart gets a reference to the given CheckRestart and assigns it to the CheckRestart field. +// SetCheckRestart gets a reference to the given NullableCheckRestart and assigns it to the CheckRestart field. func (o *ServiceCheck) SetCheckRestart(v CheckRestart) { - o.CheckRestart = &v + o.CheckRestart.Set(&v) +} +// SetCheckRestartNil sets the value for CheckRestart to be an explicit nil +func (o *ServiceCheck) SetCheckRestartNil() { + o.CheckRestart.Set(nil) +} + +// UnsetCheckRestart ensures that no value is present for CheckRestart, not even an explicit nil +func (o *ServiceCheck) UnsetCheckRestart() { + o.CheckRestart.Unset() } // GetCommand returns the Command field value if set, zero value otherwise. @@ -842,8 +852,8 @@ func (o ServiceCheck) MarshalJSON() ([]byte, error) { if o.Body != nil { toSerialize["Body"] = o.Body } - if o.CheckRestart != nil { - toSerialize["CheckRestart"] = o.CheckRestart + if o.CheckRestart.IsSet() { + toSerialize["CheckRestart"] = o.CheckRestart.Get() } if o.Command != nil { toSerialize["Command"] = o.Command diff --git a/clients/go/v1/model_service_registration.go b/clients/go/v1/model_service_registration.go index df50987c..9cd46e88 100644 --- a/clients/go/v1/model_service_registration.go +++ b/clients/go/v1/model_service_registration.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -28,7 +28,7 @@ type ServiceRegistration struct { NodeID *string `json:"NodeID,omitempty"` Port *int32 `json:"Port,omitempty"` ServiceName *string `json:"ServiceName,omitempty"` - Tags *[]string `json:"Tags,omitempty"` + Tags []string `json:"Tags,omitempty"` } // NewServiceRegistration instantiates a new ServiceRegistration object @@ -406,12 +406,12 @@ func (o *ServiceRegistration) GetTags() []string { var ret []string return ret } - return *o.Tags + return o.Tags } // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceRegistration) GetTagsOk() (*[]string, bool) { +func (o *ServiceRegistration) GetTagsOk() ([]string, bool) { if o == nil || o.Tags == nil { return nil, false } @@ -429,7 +429,7 @@ func (o *ServiceRegistration) HasTags() bool { // SetTags gets a reference to the given []string and assigns it to the Tags field. func (o *ServiceRegistration) SetTags(v []string) { - o.Tags = &v + o.Tags = v } func (o ServiceRegistration) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_sidecar_task.go b/clients/go/v1/model_sidecar_task.go index 2601ed88..3b407bde 100644 --- a/clients/go/v1/model_sidecar_task.go +++ b/clients/go/v1/model_sidecar_task.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // SidecarTask struct for SidecarTask type SidecarTask struct { - Config *map[string]interface{} `json:"Config,omitempty"` + Config map[string]interface{} `json:"Config,omitempty"` Driver *string `json:"Driver,omitempty"` Env *map[string]string `json:"Env,omitempty"` KillSignal *string `json:"KillSignal,omitempty"` @@ -25,7 +25,7 @@ type SidecarTask struct { LogConfig *LogConfig `json:"LogConfig,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` Name *string `json:"Name,omitempty"` - Resources *Resources `json:"Resources,omitempty"` + Resources NullableResources `json:"Resources,omitempty"` ShutdownDelay *int64 `json:"ShutdownDelay,omitempty"` User *string `json:"User,omitempty"` } @@ -53,12 +53,12 @@ func (o *SidecarTask) GetConfig() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Config + return o.Config } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SidecarTask) GetConfigOk() (*map[string]interface{}, bool) { +func (o *SidecarTask) GetConfigOk() (map[string]interface{}, bool) { if o == nil || o.Config == nil { return nil, false } @@ -76,7 +76,7 @@ func (o *SidecarTask) HasConfig() bool { // SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. func (o *SidecarTask) SetConfig(v map[string]interface{}) { - o.Config = &v + o.Config = v } // GetDriver returns the Driver field value if set, zero value otherwise. @@ -303,36 +303,46 @@ func (o *SidecarTask) SetName(v string) { o.Name = &v } -// GetResources returns the Resources field value if set, zero value otherwise. +// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SidecarTask) GetResources() Resources { - if o == nil || o.Resources == nil { + if o == nil || o.Resources.Get() == nil { var ret Resources return ret } - return *o.Resources + return *o.Resources.Get() } // GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise // 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 *SidecarTask) GetResourcesOk() (*Resources, bool) { - if o == nil || o.Resources == nil { + if o == nil { return nil, false } - return o.Resources, true + return o.Resources.Get(), o.Resources.IsSet() } // HasResources returns a boolean if a field has been set. func (o *SidecarTask) HasResources() bool { - if o != nil && o.Resources != nil { + if o != nil && o.Resources.IsSet() { return true } return false } -// SetResources gets a reference to the given Resources and assigns it to the Resources field. +// SetResources gets a reference to the given NullableResources and assigns it to the Resources field. func (o *SidecarTask) SetResources(v Resources) { - o.Resources = &v + o.Resources.Set(&v) +} +// SetResourcesNil sets the value for Resources to be an explicit nil +func (o *SidecarTask) SetResourcesNil() { + o.Resources.Set(nil) +} + +// UnsetResources ensures that no value is present for Resources, not even an explicit nil +func (o *SidecarTask) UnsetResources() { + o.Resources.Unset() } // GetShutdownDelay returns the ShutdownDelay field value if set, zero value otherwise. @@ -425,8 +435,8 @@ func (o SidecarTask) MarshalJSON() ([]byte, error) { if o.Name != nil { toSerialize["Name"] = o.Name } - if o.Resources != nil { - toSerialize["Resources"] = o.Resources + if o.Resources.IsSet() { + toSerialize["Resources"] = o.Resources.Get() } if o.ShutdownDelay != nil { toSerialize["ShutdownDelay"] = o.ShutdownDelay diff --git a/clients/go/v1/model_spread.go b/clients/go/v1/model_spread.go index 9d3acde4..6ec16c1f 100644 --- a/clients/go/v1/model_spread.go +++ b/clients/go/v1/model_spread.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // Spread struct for Spread type Spread struct { Attribute *string `json:"Attribute,omitempty"` - SpreadTarget *[]SpreadTarget `json:"SpreadTarget,omitempty"` + SpreadTarget []SpreadTarget `json:"SpreadTarget,omitempty"` Weight *int32 `json:"Weight,omitempty"` } @@ -77,12 +77,12 @@ func (o *Spread) GetSpreadTarget() []SpreadTarget { var ret []SpreadTarget return ret } - return *o.SpreadTarget + return o.SpreadTarget } // GetSpreadTargetOk returns a tuple with the SpreadTarget field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Spread) GetSpreadTargetOk() (*[]SpreadTarget, bool) { +func (o *Spread) GetSpreadTargetOk() ([]SpreadTarget, bool) { if o == nil || o.SpreadTarget == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *Spread) HasSpreadTarget() bool { // SetSpreadTarget gets a reference to the given []SpreadTarget and assigns it to the SpreadTarget field. func (o *Spread) SetSpreadTarget(v []SpreadTarget) { - o.SpreadTarget = &v + o.SpreadTarget = v } // GetWeight returns the Weight field value if set, zero value otherwise. diff --git a/clients/go/v1/model_spread_target.go b/clients/go/v1/model_spread_target.go index 0c44799d..da839c6c 100644 --- a/clients/go/v1/model_spread_target.go +++ b/clients/go/v1/model_spread_target.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task.go b/clients/go/v1/model_task.go index 8311f7e4..a1cea5f4 100644 --- a/clients/go/v1/model_task.go +++ b/clients/go/v1/model_task.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,31 +17,31 @@ import ( // Task struct for Task type Task struct { - Affinities *[]Affinity `json:"Affinities,omitempty"` - Artifacts *[]TaskArtifact `json:"Artifacts,omitempty"` - CSIPluginConfig *TaskCSIPluginConfig `json:"CSIPluginConfig,omitempty"` - Config *map[string]interface{} `json:"Config,omitempty"` - Constraints *[]Constraint `json:"Constraints,omitempty"` - DispatchPayload *DispatchPayloadConfig `json:"DispatchPayload,omitempty"` + Affinities []Affinity `json:"Affinities,omitempty"` + Artifacts []TaskArtifact `json:"Artifacts,omitempty"` + CSIPluginConfig NullableTaskCSIPluginConfig `json:"CSIPluginConfig,omitempty"` + Config map[string]interface{} `json:"Config,omitempty"` + Constraints []Constraint `json:"Constraints,omitempty"` + DispatchPayload NullableDispatchPayloadConfig `json:"DispatchPayload,omitempty"` Driver *string `json:"Driver,omitempty"` Env *map[string]string `json:"Env,omitempty"` KillSignal *string `json:"KillSignal,omitempty"` KillTimeout *int64 `json:"KillTimeout,omitempty"` Kind *string `json:"Kind,omitempty"` Leader *bool `json:"Leader,omitempty"` - Lifecycle *TaskLifecycle `json:"Lifecycle,omitempty"` + Lifecycle NullableTaskLifecycle `json:"Lifecycle,omitempty"` LogConfig *LogConfig `json:"LogConfig,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` Name *string `json:"Name,omitempty"` - Resources *Resources `json:"Resources,omitempty"` + Resources NullableResources `json:"Resources,omitempty"` RestartPolicy *RestartPolicy `json:"RestartPolicy,omitempty"` - ScalingPolicies *[]ScalingPolicy `json:"ScalingPolicies,omitempty"` - Services *[]Service `json:"Services,omitempty"` + ScalingPolicies []ScalingPolicy `json:"ScalingPolicies,omitempty"` + Services []Service `json:"Services,omitempty"` ShutdownDelay *int64 `json:"ShutdownDelay,omitempty"` - Templates *[]Template `json:"Templates,omitempty"` + Templates []Template `json:"Templates,omitempty"` User *string `json:"User,omitempty"` - Vault *Vault `json:"Vault,omitempty"` - VolumeMounts *[]VolumeMount `json:"VolumeMounts,omitempty"` + Vault NullableVault `json:"Vault,omitempty"` + VolumeMounts []VolumeMount `json:"VolumeMounts,omitempty"` } // NewTask instantiates a new Task object @@ -67,12 +67,12 @@ func (o *Task) GetAffinities() []Affinity { var ret []Affinity return ret } - return *o.Affinities + return o.Affinities } // GetAffinitiesOk returns a tuple with the Affinities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetAffinitiesOk() (*[]Affinity, bool) { +func (o *Task) GetAffinitiesOk() ([]Affinity, bool) { if o == nil || o.Affinities == nil { return nil, false } @@ -90,7 +90,7 @@ func (o *Task) HasAffinities() bool { // SetAffinities gets a reference to the given []Affinity and assigns it to the Affinities field. func (o *Task) SetAffinities(v []Affinity) { - o.Affinities = &v + o.Affinities = v } // GetArtifacts returns the Artifacts field value if set, zero value otherwise. @@ -99,12 +99,12 @@ func (o *Task) GetArtifacts() []TaskArtifact { var ret []TaskArtifact return ret } - return *o.Artifacts + return o.Artifacts } // GetArtifactsOk returns a tuple with the Artifacts field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetArtifactsOk() (*[]TaskArtifact, bool) { +func (o *Task) GetArtifactsOk() ([]TaskArtifact, bool) { if o == nil || o.Artifacts == nil { return nil, false } @@ -122,39 +122,49 @@ func (o *Task) HasArtifacts() bool { // SetArtifacts gets a reference to the given []TaskArtifact and assigns it to the Artifacts field. func (o *Task) SetArtifacts(v []TaskArtifact) { - o.Artifacts = &v + o.Artifacts = v } -// GetCSIPluginConfig returns the CSIPluginConfig field value if set, zero value otherwise. +// GetCSIPluginConfig returns the CSIPluginConfig field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Task) GetCSIPluginConfig() TaskCSIPluginConfig { - if o == nil || o.CSIPluginConfig == nil { + if o == nil || o.CSIPluginConfig.Get() == nil { var ret TaskCSIPluginConfig return ret } - return *o.CSIPluginConfig + return *o.CSIPluginConfig.Get() } // GetCSIPluginConfigOk returns a tuple with the CSIPluginConfig field value if set, nil otherwise // 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 *Task) GetCSIPluginConfigOk() (*TaskCSIPluginConfig, bool) { - if o == nil || o.CSIPluginConfig == nil { + if o == nil { return nil, false } - return o.CSIPluginConfig, true + return o.CSIPluginConfig.Get(), o.CSIPluginConfig.IsSet() } // HasCSIPluginConfig returns a boolean if a field has been set. func (o *Task) HasCSIPluginConfig() bool { - if o != nil && o.CSIPluginConfig != nil { + if o != nil && o.CSIPluginConfig.IsSet() { return true } return false } -// SetCSIPluginConfig gets a reference to the given TaskCSIPluginConfig and assigns it to the CSIPluginConfig field. +// SetCSIPluginConfig gets a reference to the given NullableTaskCSIPluginConfig and assigns it to the CSIPluginConfig field. func (o *Task) SetCSIPluginConfig(v TaskCSIPluginConfig) { - o.CSIPluginConfig = &v + o.CSIPluginConfig.Set(&v) +} +// SetCSIPluginConfigNil sets the value for CSIPluginConfig to be an explicit nil +func (o *Task) SetCSIPluginConfigNil() { + o.CSIPluginConfig.Set(nil) +} + +// UnsetCSIPluginConfig ensures that no value is present for CSIPluginConfig, not even an explicit nil +func (o *Task) UnsetCSIPluginConfig() { + o.CSIPluginConfig.Unset() } // GetConfig returns the Config field value if set, zero value otherwise. @@ -163,12 +173,12 @@ func (o *Task) GetConfig() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Config + return o.Config } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetConfigOk() (*map[string]interface{}, bool) { +func (o *Task) GetConfigOk() (map[string]interface{}, bool) { if o == nil || o.Config == nil { return nil, false } @@ -186,7 +196,7 @@ func (o *Task) HasConfig() bool { // SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. func (o *Task) SetConfig(v map[string]interface{}) { - o.Config = &v + o.Config = v } // GetConstraints returns the Constraints field value if set, zero value otherwise. @@ -195,12 +205,12 @@ func (o *Task) GetConstraints() []Constraint { var ret []Constraint return ret } - return *o.Constraints + return o.Constraints } // GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetConstraintsOk() (*[]Constraint, bool) { +func (o *Task) GetConstraintsOk() ([]Constraint, bool) { if o == nil || o.Constraints == nil { return nil, false } @@ -218,39 +228,49 @@ func (o *Task) HasConstraints() bool { // SetConstraints gets a reference to the given []Constraint and assigns it to the Constraints field. func (o *Task) SetConstraints(v []Constraint) { - o.Constraints = &v + o.Constraints = v } -// GetDispatchPayload returns the DispatchPayload field value if set, zero value otherwise. +// GetDispatchPayload returns the DispatchPayload field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Task) GetDispatchPayload() DispatchPayloadConfig { - if o == nil || o.DispatchPayload == nil { + if o == nil || o.DispatchPayload.Get() == nil { var ret DispatchPayloadConfig return ret } - return *o.DispatchPayload + return *o.DispatchPayload.Get() } // GetDispatchPayloadOk returns a tuple with the DispatchPayload field value if set, nil otherwise // 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 *Task) GetDispatchPayloadOk() (*DispatchPayloadConfig, bool) { - if o == nil || o.DispatchPayload == nil { + if o == nil { return nil, false } - return o.DispatchPayload, true + return o.DispatchPayload.Get(), o.DispatchPayload.IsSet() } // HasDispatchPayload returns a boolean if a field has been set. func (o *Task) HasDispatchPayload() bool { - if o != nil && o.DispatchPayload != nil { + if o != nil && o.DispatchPayload.IsSet() { return true } return false } -// SetDispatchPayload gets a reference to the given DispatchPayloadConfig and assigns it to the DispatchPayload field. +// SetDispatchPayload gets a reference to the given NullableDispatchPayloadConfig and assigns it to the DispatchPayload field. func (o *Task) SetDispatchPayload(v DispatchPayloadConfig) { - o.DispatchPayload = &v + o.DispatchPayload.Set(&v) +} +// SetDispatchPayloadNil sets the value for DispatchPayload to be an explicit nil +func (o *Task) SetDispatchPayloadNil() { + o.DispatchPayload.Set(nil) +} + +// UnsetDispatchPayload ensures that no value is present for DispatchPayload, not even an explicit nil +func (o *Task) UnsetDispatchPayload() { + o.DispatchPayload.Unset() } // GetDriver returns the Driver field value if set, zero value otherwise. @@ -445,36 +465,46 @@ func (o *Task) SetLeader(v bool) { o.Leader = &v } -// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Task) GetLifecycle() TaskLifecycle { - if o == nil || o.Lifecycle == nil { + if o == nil || o.Lifecycle.Get() == nil { var ret TaskLifecycle return ret } - return *o.Lifecycle + return *o.Lifecycle.Get() } // GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise // 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 *Task) GetLifecycleOk() (*TaskLifecycle, bool) { - if o == nil || o.Lifecycle == nil { + if o == nil { return nil, false } - return o.Lifecycle, true + return o.Lifecycle.Get(), o.Lifecycle.IsSet() } // HasLifecycle returns a boolean if a field has been set. func (o *Task) HasLifecycle() bool { - if o != nil && o.Lifecycle != nil { + if o != nil && o.Lifecycle.IsSet() { return true } return false } -// SetLifecycle gets a reference to the given TaskLifecycle and assigns it to the Lifecycle field. +// SetLifecycle gets a reference to the given NullableTaskLifecycle and assigns it to the Lifecycle field. func (o *Task) SetLifecycle(v TaskLifecycle) { - o.Lifecycle = &v + o.Lifecycle.Set(&v) +} +// SetLifecycleNil sets the value for Lifecycle to be an explicit nil +func (o *Task) SetLifecycleNil() { + o.Lifecycle.Set(nil) +} + +// UnsetLifecycle ensures that no value is present for Lifecycle, not even an explicit nil +func (o *Task) UnsetLifecycle() { + o.Lifecycle.Unset() } // GetLogConfig returns the LogConfig field value if set, zero value otherwise. @@ -573,36 +603,46 @@ func (o *Task) SetName(v string) { o.Name = &v } -// GetResources returns the Resources field value if set, zero value otherwise. +// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Task) GetResources() Resources { - if o == nil || o.Resources == nil { + if o == nil || o.Resources.Get() == nil { var ret Resources return ret } - return *o.Resources + return *o.Resources.Get() } // GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise // 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 *Task) GetResourcesOk() (*Resources, bool) { - if o == nil || o.Resources == nil { + if o == nil { return nil, false } - return o.Resources, true + return o.Resources.Get(), o.Resources.IsSet() } // HasResources returns a boolean if a field has been set. func (o *Task) HasResources() bool { - if o != nil && o.Resources != nil { + if o != nil && o.Resources.IsSet() { return true } return false } -// SetResources gets a reference to the given Resources and assigns it to the Resources field. +// SetResources gets a reference to the given NullableResources and assigns it to the Resources field. func (o *Task) SetResources(v Resources) { - o.Resources = &v + o.Resources.Set(&v) +} +// SetResourcesNil sets the value for Resources to be an explicit nil +func (o *Task) SetResourcesNil() { + o.Resources.Set(nil) +} + +// UnsetResources ensures that no value is present for Resources, not even an explicit nil +func (o *Task) UnsetResources() { + o.Resources.Unset() } // GetRestartPolicy returns the RestartPolicy field value if set, zero value otherwise. @@ -643,12 +683,12 @@ func (o *Task) GetScalingPolicies() []ScalingPolicy { var ret []ScalingPolicy return ret } - return *o.ScalingPolicies + return o.ScalingPolicies } // GetScalingPoliciesOk returns a tuple with the ScalingPolicies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetScalingPoliciesOk() (*[]ScalingPolicy, bool) { +func (o *Task) GetScalingPoliciesOk() ([]ScalingPolicy, bool) { if o == nil || o.ScalingPolicies == nil { return nil, false } @@ -666,7 +706,7 @@ func (o *Task) HasScalingPolicies() bool { // SetScalingPolicies gets a reference to the given []ScalingPolicy and assigns it to the ScalingPolicies field. func (o *Task) SetScalingPolicies(v []ScalingPolicy) { - o.ScalingPolicies = &v + o.ScalingPolicies = v } // GetServices returns the Services field value if set, zero value otherwise. @@ -675,12 +715,12 @@ func (o *Task) GetServices() []Service { var ret []Service return ret } - return *o.Services + return o.Services } // GetServicesOk returns a tuple with the Services field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetServicesOk() (*[]Service, bool) { +func (o *Task) GetServicesOk() ([]Service, bool) { if o == nil || o.Services == nil { return nil, false } @@ -698,7 +738,7 @@ func (o *Task) HasServices() bool { // SetServices gets a reference to the given []Service and assigns it to the Services field. func (o *Task) SetServices(v []Service) { - o.Services = &v + o.Services = v } // GetShutdownDelay returns the ShutdownDelay field value if set, zero value otherwise. @@ -739,12 +779,12 @@ func (o *Task) GetTemplates() []Template { var ret []Template return ret } - return *o.Templates + return o.Templates } // GetTemplatesOk returns a tuple with the Templates field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetTemplatesOk() (*[]Template, bool) { +func (o *Task) GetTemplatesOk() ([]Template, bool) { if o == nil || o.Templates == nil { return nil, false } @@ -762,7 +802,7 @@ func (o *Task) HasTemplates() bool { // SetTemplates gets a reference to the given []Template and assigns it to the Templates field. func (o *Task) SetTemplates(v []Template) { - o.Templates = &v + o.Templates = v } // GetUser returns the User field value if set, zero value otherwise. @@ -797,36 +837,46 @@ func (o *Task) SetUser(v string) { o.User = &v } -// GetVault returns the Vault field value if set, zero value otherwise. +// GetVault returns the Vault field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Task) GetVault() Vault { - if o == nil || o.Vault == nil { + if o == nil || o.Vault.Get() == nil { var ret Vault return ret } - return *o.Vault + return *o.Vault.Get() } // GetVaultOk returns a tuple with the Vault field value if set, nil otherwise // 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 *Task) GetVaultOk() (*Vault, bool) { - if o == nil || o.Vault == nil { + if o == nil { return nil, false } - return o.Vault, true + return o.Vault.Get(), o.Vault.IsSet() } // HasVault returns a boolean if a field has been set. func (o *Task) HasVault() bool { - if o != nil && o.Vault != nil { + if o != nil && o.Vault.IsSet() { return true } return false } -// SetVault gets a reference to the given Vault and assigns it to the Vault field. +// SetVault gets a reference to the given NullableVault and assigns it to the Vault field. func (o *Task) SetVault(v Vault) { - o.Vault = &v + o.Vault.Set(&v) +} +// SetVaultNil sets the value for Vault to be an explicit nil +func (o *Task) SetVaultNil() { + o.Vault.Set(nil) +} + +// UnsetVault ensures that no value is present for Vault, not even an explicit nil +func (o *Task) UnsetVault() { + o.Vault.Unset() } // GetVolumeMounts returns the VolumeMounts field value if set, zero value otherwise. @@ -835,12 +885,12 @@ func (o *Task) GetVolumeMounts() []VolumeMount { var ret []VolumeMount return ret } - return *o.VolumeMounts + return o.VolumeMounts } // GetVolumeMountsOk returns a tuple with the VolumeMounts field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetVolumeMountsOk() (*[]VolumeMount, bool) { +func (o *Task) GetVolumeMountsOk() ([]VolumeMount, bool) { if o == nil || o.VolumeMounts == nil { return nil, false } @@ -858,7 +908,7 @@ func (o *Task) HasVolumeMounts() bool { // SetVolumeMounts gets a reference to the given []VolumeMount and assigns it to the VolumeMounts field. func (o *Task) SetVolumeMounts(v []VolumeMount) { - o.VolumeMounts = &v + o.VolumeMounts = v } func (o Task) MarshalJSON() ([]byte, error) { @@ -869,8 +919,8 @@ func (o Task) MarshalJSON() ([]byte, error) { if o.Artifacts != nil { toSerialize["Artifacts"] = o.Artifacts } - if o.CSIPluginConfig != nil { - toSerialize["CSIPluginConfig"] = o.CSIPluginConfig + if o.CSIPluginConfig.IsSet() { + toSerialize["CSIPluginConfig"] = o.CSIPluginConfig.Get() } if o.Config != nil { toSerialize["Config"] = o.Config @@ -878,8 +928,8 @@ func (o Task) MarshalJSON() ([]byte, error) { if o.Constraints != nil { toSerialize["Constraints"] = o.Constraints } - if o.DispatchPayload != nil { - toSerialize["DispatchPayload"] = o.DispatchPayload + if o.DispatchPayload.IsSet() { + toSerialize["DispatchPayload"] = o.DispatchPayload.Get() } if o.Driver != nil { toSerialize["Driver"] = o.Driver @@ -899,8 +949,8 @@ func (o Task) MarshalJSON() ([]byte, error) { if o.Leader != nil { toSerialize["Leader"] = o.Leader } - if o.Lifecycle != nil { - toSerialize["Lifecycle"] = o.Lifecycle + if o.Lifecycle.IsSet() { + toSerialize["Lifecycle"] = o.Lifecycle.Get() } if o.LogConfig != nil { toSerialize["LogConfig"] = o.LogConfig @@ -911,8 +961,8 @@ func (o Task) MarshalJSON() ([]byte, error) { if o.Name != nil { toSerialize["Name"] = o.Name } - if o.Resources != nil { - toSerialize["Resources"] = o.Resources + if o.Resources.IsSet() { + toSerialize["Resources"] = o.Resources.Get() } if o.RestartPolicy != nil { toSerialize["RestartPolicy"] = o.RestartPolicy @@ -932,8 +982,8 @@ func (o Task) MarshalJSON() ([]byte, error) { if o.User != nil { toSerialize["User"] = o.User } - if o.Vault != nil { - toSerialize["Vault"] = o.Vault + if o.Vault.IsSet() { + toSerialize["Vault"] = o.Vault.Get() } if o.VolumeMounts != nil { toSerialize["VolumeMounts"] = o.VolumeMounts diff --git a/clients/go/v1/model_task_artifact.go b/clients/go/v1/model_task_artifact.go index b96a9225..03fc457b 100644 --- a/clients/go/v1/model_task_artifact.go +++ b/clients/go/v1/model_task_artifact.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task_csi_plugin_config.go b/clients/go/v1/model_task_csi_plugin_config.go index bfe7c93c..ab76101a 100644 --- a/clients/go/v1/model_task_csi_plugin_config.go +++ b/clients/go/v1/model_task_csi_plugin_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task_diff.go b/clients/go/v1/model_task_diff.go index d20555ea..af46bf9f 100644 --- a/clients/go/v1/model_task_diff.go +++ b/clients/go/v1/model_task_diff.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // TaskDiff struct for TaskDiff type TaskDiff struct { - Annotations *[]string `json:"Annotations,omitempty"` - Fields *[]FieldDiff `json:"Fields,omitempty"` + Annotations []string `json:"Annotations,omitempty"` + Fields []FieldDiff `json:"Fields,omitempty"` Name *string `json:"Name,omitempty"` - Objects *[]ObjectDiff `json:"Objects,omitempty"` + Objects []ObjectDiff `json:"Objects,omitempty"` Type *string `json:"Type,omitempty"` } @@ -47,12 +47,12 @@ func (o *TaskDiff) GetAnnotations() []string { var ret []string return ret } - return *o.Annotations + return o.Annotations } // GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskDiff) GetAnnotationsOk() (*[]string, bool) { +func (o *TaskDiff) GetAnnotationsOk() ([]string, bool) { if o == nil || o.Annotations == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *TaskDiff) HasAnnotations() bool { // SetAnnotations gets a reference to the given []string and assigns it to the Annotations field. func (o *TaskDiff) SetAnnotations(v []string) { - o.Annotations = &v + o.Annotations = v } // GetFields returns the Fields field value if set, zero value otherwise. @@ -79,12 +79,12 @@ func (o *TaskDiff) GetFields() []FieldDiff { var ret []FieldDiff return ret } - return *o.Fields + return o.Fields } // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskDiff) GetFieldsOk() (*[]FieldDiff, bool) { +func (o *TaskDiff) GetFieldsOk() ([]FieldDiff, bool) { if o == nil || o.Fields == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *TaskDiff) HasFields() bool { // SetFields gets a reference to the given []FieldDiff and assigns it to the Fields field. func (o *TaskDiff) SetFields(v []FieldDiff) { - o.Fields = &v + o.Fields = v } // GetName returns the Name field value if set, zero value otherwise. @@ -143,12 +143,12 @@ func (o *TaskDiff) GetObjects() []ObjectDiff { var ret []ObjectDiff return ret } - return *o.Objects + return o.Objects } // GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskDiff) GetObjectsOk() (*[]ObjectDiff, bool) { +func (o *TaskDiff) GetObjectsOk() ([]ObjectDiff, bool) { if o == nil || o.Objects == nil { return nil, false } @@ -166,7 +166,7 @@ func (o *TaskDiff) HasObjects() bool { // SetObjects gets a reference to the given []ObjectDiff and assigns it to the Objects field. func (o *TaskDiff) SetObjects(v []ObjectDiff) { - o.Objects = &v + o.Objects = v } // GetType returns the Type field value if set, zero value otherwise. diff --git a/clients/go/v1/model_task_event.go b/clients/go/v1/model_task_event.go index eba44cf4..94c164a1 100644 --- a/clients/go/v1/model_task_event.go +++ b/clients/go/v1/model_task_event.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task_group.go b/clients/go/v1/model_task_group.go index 9468f375..0de4d0b1 100644 --- a/clients/go/v1/model_task_group.go +++ b/clients/go/v1/model_task_group.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,24 +17,24 @@ import ( // TaskGroup struct for TaskGroup type TaskGroup struct { - Affinities *[]Affinity `json:"Affinities,omitempty"` - Constraints *[]Constraint `json:"Constraints,omitempty"` - Consul *Consul `json:"Consul,omitempty"` + Affinities []Affinity `json:"Affinities,omitempty"` + Constraints []Constraint `json:"Constraints,omitempty"` + Consul NullableConsul `json:"Consul,omitempty"` Count *int32 `json:"Count,omitempty"` EphemeralDisk *EphemeralDisk `json:"EphemeralDisk,omitempty"` MaxClientDisconnect *int64 `json:"MaxClientDisconnect,omitempty"` Meta *map[string]string `json:"Meta,omitempty"` Migrate *MigrateStrategy `json:"Migrate,omitempty"` Name *string `json:"Name,omitempty"` - Networks *[]NetworkResource `json:"Networks,omitempty"` + Networks []NetworkResource `json:"Networks,omitempty"` ReschedulePolicy *ReschedulePolicy `json:"ReschedulePolicy,omitempty"` RestartPolicy *RestartPolicy `json:"RestartPolicy,omitempty"` - Scaling *ScalingPolicy `json:"Scaling,omitempty"` - Services *[]Service `json:"Services,omitempty"` + Scaling NullableScalingPolicy `json:"Scaling,omitempty"` + Services []Service `json:"Services,omitempty"` ShutdownDelay *int64 `json:"ShutdownDelay,omitempty"` - Spreads *[]Spread `json:"Spreads,omitempty"` + Spreads []Spread `json:"Spreads,omitempty"` StopAfterClientDisconnect *int64 `json:"StopAfterClientDisconnect,omitempty"` - Tasks *[]Task `json:"Tasks,omitempty"` + Tasks []Task `json:"Tasks,omitempty"` Update *UpdateStrategy `json:"Update,omitempty"` Volumes *map[string]VolumeRequest `json:"Volumes,omitempty"` } @@ -62,12 +62,12 @@ func (o *TaskGroup) GetAffinities() []Affinity { var ret []Affinity return ret } - return *o.Affinities + return o.Affinities } // GetAffinitiesOk returns a tuple with the Affinities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroup) GetAffinitiesOk() (*[]Affinity, bool) { +func (o *TaskGroup) GetAffinitiesOk() ([]Affinity, bool) { if o == nil || o.Affinities == nil { return nil, false } @@ -85,7 +85,7 @@ func (o *TaskGroup) HasAffinities() bool { // SetAffinities gets a reference to the given []Affinity and assigns it to the Affinities field. func (o *TaskGroup) SetAffinities(v []Affinity) { - o.Affinities = &v + o.Affinities = v } // GetConstraints returns the Constraints field value if set, zero value otherwise. @@ -94,12 +94,12 @@ func (o *TaskGroup) GetConstraints() []Constraint { var ret []Constraint return ret } - return *o.Constraints + return o.Constraints } // GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroup) GetConstraintsOk() (*[]Constraint, bool) { +func (o *TaskGroup) GetConstraintsOk() ([]Constraint, bool) { if o == nil || o.Constraints == nil { return nil, false } @@ -117,39 +117,49 @@ func (o *TaskGroup) HasConstraints() bool { // SetConstraints gets a reference to the given []Constraint and assigns it to the Constraints field. func (o *TaskGroup) SetConstraints(v []Constraint) { - o.Constraints = &v + o.Constraints = v } -// GetConsul returns the Consul field value if set, zero value otherwise. +// GetConsul returns the Consul field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskGroup) GetConsul() Consul { - if o == nil || o.Consul == nil { + if o == nil || o.Consul.Get() == nil { var ret Consul return ret } - return *o.Consul + return *o.Consul.Get() } // GetConsulOk returns a tuple with the Consul field value if set, nil otherwise // 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 *TaskGroup) GetConsulOk() (*Consul, bool) { - if o == nil || o.Consul == nil { + if o == nil { return nil, false } - return o.Consul, true + return o.Consul.Get(), o.Consul.IsSet() } // HasConsul returns a boolean if a field has been set. func (o *TaskGroup) HasConsul() bool { - if o != nil && o.Consul != nil { + if o != nil && o.Consul.IsSet() { return true } return false } -// SetConsul gets a reference to the given Consul and assigns it to the Consul field. +// SetConsul gets a reference to the given NullableConsul and assigns it to the Consul field. func (o *TaskGroup) SetConsul(v Consul) { - o.Consul = &v + o.Consul.Set(&v) +} +// SetConsulNil sets the value for Consul to be an explicit nil +func (o *TaskGroup) SetConsulNil() { + o.Consul.Set(nil) +} + +// UnsetConsul ensures that no value is present for Consul, not even an explicit nil +func (o *TaskGroup) UnsetConsul() { + o.Consul.Unset() } // GetCount returns the Count field value if set, zero value otherwise. @@ -350,12 +360,12 @@ func (o *TaskGroup) GetNetworks() []NetworkResource { var ret []NetworkResource return ret } - return *o.Networks + return o.Networks } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroup) GetNetworksOk() (*[]NetworkResource, bool) { +func (o *TaskGroup) GetNetworksOk() ([]NetworkResource, bool) { if o == nil || o.Networks == nil { return nil, false } @@ -373,7 +383,7 @@ func (o *TaskGroup) HasNetworks() bool { // SetNetworks gets a reference to the given []NetworkResource and assigns it to the Networks field. func (o *TaskGroup) SetNetworks(v []NetworkResource) { - o.Networks = &v + o.Networks = v } // GetReschedulePolicy returns the ReschedulePolicy field value if set, zero value otherwise. @@ -440,36 +450,46 @@ func (o *TaskGroup) SetRestartPolicy(v RestartPolicy) { o.RestartPolicy = &v } -// GetScaling returns the Scaling field value if set, zero value otherwise. +// GetScaling returns the Scaling field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskGroup) GetScaling() ScalingPolicy { - if o == nil || o.Scaling == nil { + if o == nil || o.Scaling.Get() == nil { var ret ScalingPolicy return ret } - return *o.Scaling + return *o.Scaling.Get() } // GetScalingOk returns a tuple with the Scaling field value if set, nil otherwise // 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 *TaskGroup) GetScalingOk() (*ScalingPolicy, bool) { - if o == nil || o.Scaling == nil { + if o == nil { return nil, false } - return o.Scaling, true + return o.Scaling.Get(), o.Scaling.IsSet() } // HasScaling returns a boolean if a field has been set. func (o *TaskGroup) HasScaling() bool { - if o != nil && o.Scaling != nil { + if o != nil && o.Scaling.IsSet() { return true } return false } -// SetScaling gets a reference to the given ScalingPolicy and assigns it to the Scaling field. +// SetScaling gets a reference to the given NullableScalingPolicy and assigns it to the Scaling field. func (o *TaskGroup) SetScaling(v ScalingPolicy) { - o.Scaling = &v + o.Scaling.Set(&v) +} +// SetScalingNil sets the value for Scaling to be an explicit nil +func (o *TaskGroup) SetScalingNil() { + o.Scaling.Set(nil) +} + +// UnsetScaling ensures that no value is present for Scaling, not even an explicit nil +func (o *TaskGroup) UnsetScaling() { + o.Scaling.Unset() } // GetServices returns the Services field value if set, zero value otherwise. @@ -478,12 +498,12 @@ func (o *TaskGroup) GetServices() []Service { var ret []Service return ret } - return *o.Services + return o.Services } // GetServicesOk returns a tuple with the Services field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroup) GetServicesOk() (*[]Service, bool) { +func (o *TaskGroup) GetServicesOk() ([]Service, bool) { if o == nil || o.Services == nil { return nil, false } @@ -501,7 +521,7 @@ func (o *TaskGroup) HasServices() bool { // SetServices gets a reference to the given []Service and assigns it to the Services field. func (o *TaskGroup) SetServices(v []Service) { - o.Services = &v + o.Services = v } // GetShutdownDelay returns the ShutdownDelay field value if set, zero value otherwise. @@ -542,12 +562,12 @@ func (o *TaskGroup) GetSpreads() []Spread { var ret []Spread return ret } - return *o.Spreads + return o.Spreads } // GetSpreadsOk returns a tuple with the Spreads field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroup) GetSpreadsOk() (*[]Spread, bool) { +func (o *TaskGroup) GetSpreadsOk() ([]Spread, bool) { if o == nil || o.Spreads == nil { return nil, false } @@ -565,7 +585,7 @@ func (o *TaskGroup) HasSpreads() bool { // SetSpreads gets a reference to the given []Spread and assigns it to the Spreads field. func (o *TaskGroup) SetSpreads(v []Spread) { - o.Spreads = &v + o.Spreads = v } // GetStopAfterClientDisconnect returns the StopAfterClientDisconnect field value if set, zero value otherwise. @@ -606,12 +626,12 @@ func (o *TaskGroup) GetTasks() []Task { var ret []Task return ret } - return *o.Tasks + return o.Tasks } // GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroup) GetTasksOk() (*[]Task, bool) { +func (o *TaskGroup) GetTasksOk() ([]Task, bool) { if o == nil || o.Tasks == nil { return nil, false } @@ -629,7 +649,7 @@ func (o *TaskGroup) HasTasks() bool { // SetTasks gets a reference to the given []Task and assigns it to the Tasks field. func (o *TaskGroup) SetTasks(v []Task) { - o.Tasks = &v + o.Tasks = v } // GetUpdate returns the Update field value if set, zero value otherwise. @@ -704,8 +724,8 @@ func (o TaskGroup) MarshalJSON() ([]byte, error) { if o.Constraints != nil { toSerialize["Constraints"] = o.Constraints } - if o.Consul != nil { - toSerialize["Consul"] = o.Consul + if o.Consul.IsSet() { + toSerialize["Consul"] = o.Consul.Get() } if o.Count != nil { toSerialize["Count"] = o.Count @@ -734,8 +754,8 @@ func (o TaskGroup) MarshalJSON() ([]byte, error) { if o.RestartPolicy != nil { toSerialize["RestartPolicy"] = o.RestartPolicy } - if o.Scaling != nil { - toSerialize["Scaling"] = o.Scaling + if o.Scaling.IsSet() { + toSerialize["Scaling"] = o.Scaling.Get() } if o.Services != nil { toSerialize["Services"] = o.Services diff --git a/clients/go/v1/model_task_group_diff.go b/clients/go/v1/model_task_group_diff.go index 120fc8cd..8e8ba5a8 100644 --- a/clients/go/v1/model_task_group_diff.go +++ b/clients/go/v1/model_task_group_diff.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,10 @@ import ( // TaskGroupDiff struct for TaskGroupDiff type TaskGroupDiff struct { - Fields *[]FieldDiff `json:"Fields,omitempty"` + Fields []FieldDiff `json:"Fields,omitempty"` Name *string `json:"Name,omitempty"` - Objects *[]ObjectDiff `json:"Objects,omitempty"` - Tasks *[]TaskDiff `json:"Tasks,omitempty"` + Objects []ObjectDiff `json:"Objects,omitempty"` + Tasks []TaskDiff `json:"Tasks,omitempty"` Type *string `json:"Type,omitempty"` Updates *map[string]int32 `json:"Updates,omitempty"` } @@ -48,12 +48,12 @@ func (o *TaskGroupDiff) GetFields() []FieldDiff { var ret []FieldDiff return ret } - return *o.Fields + return o.Fields } // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroupDiff) GetFieldsOk() (*[]FieldDiff, bool) { +func (o *TaskGroupDiff) GetFieldsOk() ([]FieldDiff, bool) { if o == nil || o.Fields == nil { return nil, false } @@ -71,7 +71,7 @@ func (o *TaskGroupDiff) HasFields() bool { // SetFields gets a reference to the given []FieldDiff and assigns it to the Fields field. func (o *TaskGroupDiff) SetFields(v []FieldDiff) { - o.Fields = &v + o.Fields = v } // GetName returns the Name field value if set, zero value otherwise. @@ -112,12 +112,12 @@ func (o *TaskGroupDiff) GetObjects() []ObjectDiff { var ret []ObjectDiff return ret } - return *o.Objects + return o.Objects } // GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroupDiff) GetObjectsOk() (*[]ObjectDiff, bool) { +func (o *TaskGroupDiff) GetObjectsOk() ([]ObjectDiff, bool) { if o == nil || o.Objects == nil { return nil, false } @@ -135,7 +135,7 @@ func (o *TaskGroupDiff) HasObjects() bool { // SetObjects gets a reference to the given []ObjectDiff and assigns it to the Objects field. func (o *TaskGroupDiff) SetObjects(v []ObjectDiff) { - o.Objects = &v + o.Objects = v } // GetTasks returns the Tasks field value if set, zero value otherwise. @@ -144,12 +144,12 @@ func (o *TaskGroupDiff) GetTasks() []TaskDiff { var ret []TaskDiff return ret } - return *o.Tasks + return o.Tasks } // GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroupDiff) GetTasksOk() (*[]TaskDiff, bool) { +func (o *TaskGroupDiff) GetTasksOk() ([]TaskDiff, bool) { if o == nil || o.Tasks == nil { return nil, false } @@ -167,7 +167,7 @@ func (o *TaskGroupDiff) HasTasks() bool { // SetTasks gets a reference to the given []TaskDiff and assigns it to the Tasks field. func (o *TaskGroupDiff) SetTasks(v []TaskDiff) { - o.Tasks = &v + o.Tasks = v } // GetType returns the Type field value if set, zero value otherwise. diff --git a/clients/go/v1/model_task_group_scale_status.go b/clients/go/v1/model_task_group_scale_status.go index 03b0bdb4..29f21948 100644 --- a/clients/go/v1/model_task_group_scale_status.go +++ b/clients/go/v1/model_task_group_scale_status.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // TaskGroupScaleStatus struct for TaskGroupScaleStatus type TaskGroupScaleStatus struct { Desired *int32 `json:"Desired,omitempty"` - Events *[]ScalingEvent `json:"Events,omitempty"` + Events []ScalingEvent `json:"Events,omitempty"` Healthy *int32 `json:"Healthy,omitempty"` Placed *int32 `json:"Placed,omitempty"` Running *int32 `json:"Running,omitempty"` @@ -80,12 +80,12 @@ func (o *TaskGroupScaleStatus) GetEvents() []ScalingEvent { var ret []ScalingEvent return ret } - return *o.Events + return o.Events } // GetEventsOk returns a tuple with the Events field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskGroupScaleStatus) GetEventsOk() (*[]ScalingEvent, bool) { +func (o *TaskGroupScaleStatus) GetEventsOk() ([]ScalingEvent, bool) { if o == nil || o.Events == nil { return nil, false } @@ -103,7 +103,7 @@ func (o *TaskGroupScaleStatus) HasEvents() bool { // SetEvents gets a reference to the given []ScalingEvent and assigns it to the Events field. func (o *TaskGroupScaleStatus) SetEvents(v []ScalingEvent) { - o.Events = &v + o.Events = v } // GetHealthy returns the Healthy field value if set, zero value otherwise. diff --git a/clients/go/v1/model_task_group_summary.go b/clients/go/v1/model_task_group_summary.go index 444926f3..af8497bd 100644 --- a/clients/go/v1/model_task_group_summary.go +++ b/clients/go/v1/model_task_group_summary.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task_handle.go b/clients/go/v1/model_task_handle.go index 50d5c8a7..c148a0a5 100644 --- a/clients/go/v1/model_task_handle.go +++ b/clients/go/v1/model_task_handle.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task_lifecycle.go b/clients/go/v1/model_task_lifecycle.go index 352095b7..396dcf1d 100644 --- a/clients/go/v1/model_task_lifecycle.go +++ b/clients/go/v1/model_task_lifecycle.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_task_state.go b/clients/go/v1/model_task_state.go index d930a27e..94a3157f 100644 --- a/clients/go/v1/model_task_state.go +++ b/clients/go/v1/model_task_state.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,14 +18,14 @@ import ( // TaskState struct for TaskState type TaskState struct { - Events *[]TaskEvent `json:"Events,omitempty"` + Events []TaskEvent `json:"Events,omitempty"` Failed *bool `json:"Failed,omitempty"` - FinishedAt *time.Time `json:"FinishedAt,omitempty"` - LastRestart *time.Time `json:"LastRestart,omitempty"` + FinishedAt NullableTime `json:"FinishedAt,omitempty"` + LastRestart NullableTime `json:"LastRestart,omitempty"` Restarts *int32 `json:"Restarts,omitempty"` - StartedAt *time.Time `json:"StartedAt,omitempty"` + StartedAt NullableTime `json:"StartedAt,omitempty"` State *string `json:"State,omitempty"` - TaskHandle *TaskHandle `json:"TaskHandle,omitempty"` + TaskHandle NullableTaskHandle `json:"TaskHandle,omitempty"` } // NewTaskState instantiates a new TaskState object @@ -51,12 +51,12 @@ func (o *TaskState) GetEvents() []TaskEvent { var ret []TaskEvent return ret } - return *o.Events + return o.Events } // GetEventsOk returns a tuple with the Events field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskState) GetEventsOk() (*[]TaskEvent, bool) { +func (o *TaskState) GetEventsOk() ([]TaskEvent, bool) { if o == nil || o.Events == nil { return nil, false } @@ -74,7 +74,7 @@ func (o *TaskState) HasEvents() bool { // SetEvents gets a reference to the given []TaskEvent and assigns it to the Events field. func (o *TaskState) SetEvents(v []TaskEvent) { - o.Events = &v + o.Events = v } // GetFailed returns the Failed field value if set, zero value otherwise. @@ -109,68 +109,88 @@ func (o *TaskState) SetFailed(v bool) { o.Failed = &v } -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise. +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskState) GetFinishedAt() time.Time { - if o == nil || o.FinishedAt == nil { + if o == nil || o.FinishedAt.Get() == nil { var ret time.Time return ret } - return *o.FinishedAt + return *o.FinishedAt.Get() } // GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise // 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 *TaskState) GetFinishedAtOk() (*time.Time, bool) { - if o == nil || o.FinishedAt == nil { + if o == nil { return nil, false } - return o.FinishedAt, true + return o.FinishedAt.Get(), o.FinishedAt.IsSet() } // HasFinishedAt returns a boolean if a field has been set. func (o *TaskState) HasFinishedAt() bool { - if o != nil && o.FinishedAt != nil { + if o != nil && o.FinishedAt.IsSet() { return true } return false } -// SetFinishedAt gets a reference to the given time.Time and assigns it to the FinishedAt field. +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. func (o *TaskState) SetFinishedAt(v time.Time) { - o.FinishedAt = &v + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *TaskState) SetFinishedAtNil() { + o.FinishedAt.Set(nil) } -// GetLastRestart returns the LastRestart field value if set, zero value otherwise. +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *TaskState) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetLastRestart returns the LastRestart field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskState) GetLastRestart() time.Time { - if o == nil || o.LastRestart == nil { + if o == nil || o.LastRestart.Get() == nil { var ret time.Time return ret } - return *o.LastRestart + return *o.LastRestart.Get() } // GetLastRestartOk returns a tuple with the LastRestart field value if set, nil otherwise // 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 *TaskState) GetLastRestartOk() (*time.Time, bool) { - if o == nil || o.LastRestart == nil { + if o == nil { return nil, false } - return o.LastRestart, true + return o.LastRestart.Get(), o.LastRestart.IsSet() } // HasLastRestart returns a boolean if a field has been set. func (o *TaskState) HasLastRestart() bool { - if o != nil && o.LastRestart != nil { + if o != nil && o.LastRestart.IsSet() { return true } return false } -// SetLastRestart gets a reference to the given time.Time and assigns it to the LastRestart field. +// SetLastRestart gets a reference to the given NullableTime and assigns it to the LastRestart field. func (o *TaskState) SetLastRestart(v time.Time) { - o.LastRestart = &v + o.LastRestart.Set(&v) +} +// SetLastRestartNil sets the value for LastRestart to be an explicit nil +func (o *TaskState) SetLastRestartNil() { + o.LastRestart.Set(nil) +} + +// UnsetLastRestart ensures that no value is present for LastRestart, not even an explicit nil +func (o *TaskState) UnsetLastRestart() { + o.LastRestart.Unset() } // GetRestarts returns the Restarts field value if set, zero value otherwise. @@ -205,36 +225,46 @@ func (o *TaskState) SetRestarts(v int32) { o.Restarts = &v } -// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +// GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskState) GetStartedAt() time.Time { - if o == nil || o.StartedAt == nil { + if o == nil || o.StartedAt.Get() == nil { var ret time.Time return ret } - return *o.StartedAt + return *o.StartedAt.Get() } // GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise // 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 *TaskState) GetStartedAtOk() (*time.Time, bool) { - if o == nil || o.StartedAt == nil { + if o == nil { return nil, false } - return o.StartedAt, true + return o.StartedAt.Get(), o.StartedAt.IsSet() } // HasStartedAt returns a boolean if a field has been set. func (o *TaskState) HasStartedAt() bool { - if o != nil && o.StartedAt != nil { + if o != nil && o.StartedAt.IsSet() { return true } return false } -// SetStartedAt gets a reference to the given time.Time and assigns it to the StartedAt field. +// SetStartedAt gets a reference to the given NullableTime and assigns it to the StartedAt field. func (o *TaskState) SetStartedAt(v time.Time) { - o.StartedAt = &v + o.StartedAt.Set(&v) +} +// SetStartedAtNil sets the value for StartedAt to be an explicit nil +func (o *TaskState) SetStartedAtNil() { + o.StartedAt.Set(nil) +} + +// UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil +func (o *TaskState) UnsetStartedAt() { + o.StartedAt.Unset() } // GetState returns the State field value if set, zero value otherwise. @@ -269,36 +299,46 @@ func (o *TaskState) SetState(v string) { o.State = &v } -// GetTaskHandle returns the TaskHandle field value if set, zero value otherwise. +// GetTaskHandle returns the TaskHandle field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskState) GetTaskHandle() TaskHandle { - if o == nil || o.TaskHandle == nil { + if o == nil || o.TaskHandle.Get() == nil { var ret TaskHandle return ret } - return *o.TaskHandle + return *o.TaskHandle.Get() } // GetTaskHandleOk returns a tuple with the TaskHandle field value if set, nil otherwise // 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 *TaskState) GetTaskHandleOk() (*TaskHandle, bool) { - if o == nil || o.TaskHandle == nil { + if o == nil { return nil, false } - return o.TaskHandle, true + return o.TaskHandle.Get(), o.TaskHandle.IsSet() } // HasTaskHandle returns a boolean if a field has been set. func (o *TaskState) HasTaskHandle() bool { - if o != nil && o.TaskHandle != nil { + if o != nil && o.TaskHandle.IsSet() { return true } return false } -// SetTaskHandle gets a reference to the given TaskHandle and assigns it to the TaskHandle field. +// SetTaskHandle gets a reference to the given NullableTaskHandle and assigns it to the TaskHandle field. func (o *TaskState) SetTaskHandle(v TaskHandle) { - o.TaskHandle = &v + o.TaskHandle.Set(&v) +} +// SetTaskHandleNil sets the value for TaskHandle to be an explicit nil +func (o *TaskState) SetTaskHandleNil() { + o.TaskHandle.Set(nil) +} + +// UnsetTaskHandle ensures that no value is present for TaskHandle, not even an explicit nil +func (o *TaskState) UnsetTaskHandle() { + o.TaskHandle.Unset() } func (o TaskState) MarshalJSON() ([]byte, error) { @@ -309,23 +349,23 @@ func (o TaskState) MarshalJSON() ([]byte, error) { if o.Failed != nil { toSerialize["Failed"] = o.Failed } - if o.FinishedAt != nil { - toSerialize["FinishedAt"] = o.FinishedAt + if o.FinishedAt.IsSet() { + toSerialize["FinishedAt"] = o.FinishedAt.Get() } - if o.LastRestart != nil { - toSerialize["LastRestart"] = o.LastRestart + if o.LastRestart.IsSet() { + toSerialize["LastRestart"] = o.LastRestart.Get() } if o.Restarts != nil { toSerialize["Restarts"] = o.Restarts } - if o.StartedAt != nil { - toSerialize["StartedAt"] = o.StartedAt + if o.StartedAt.IsSet() { + toSerialize["StartedAt"] = o.StartedAt.Get() } if o.State != nil { toSerialize["State"] = o.State } - if o.TaskHandle != nil { - toSerialize["TaskHandle"] = o.TaskHandle + if o.TaskHandle.IsSet() { + toSerialize["TaskHandle"] = o.TaskHandle.Get() } return json.Marshal(toSerialize) } diff --git a/clients/go/v1/model_template.go b/clients/go/v1/model_template.go index 48013705..4f873afa 100644 --- a/clients/go/v1/model_template.go +++ b/clients/go/v1/model_template.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_update_strategy.go b/clients/go/v1/model_update_strategy.go index f9e67fe3..c3a5345a 100644 --- a/clients/go/v1/model_update_strategy.go +++ b/clients/go/v1/model_update_strategy.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_vault.go b/clients/go/v1/model_vault.go index 1ea7554c..f47ff34f 100644 --- a/clients/go/v1/model_vault.go +++ b/clients/go/v1/model_vault.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,7 +21,7 @@ type Vault struct { ChangeSignal *string `json:"ChangeSignal,omitempty"` Env *bool `json:"Env,omitempty"` Namespace *string `json:"Namespace,omitempty"` - Policies *[]string `json:"Policies,omitempty"` + Policies []string `json:"Policies,omitempty"` } // NewVault instantiates a new Vault object @@ -175,12 +175,12 @@ func (o *Vault) GetPolicies() []string { var ret []string return ret } - return *o.Policies + return o.Policies } // GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Vault) GetPoliciesOk() (*[]string, bool) { +func (o *Vault) GetPoliciesOk() ([]string, bool) { if o == nil || o.Policies == nil { return nil, false } @@ -198,7 +198,7 @@ func (o *Vault) HasPolicies() bool { // SetPolicies gets a reference to the given []string and assigns it to the Policies field. func (o *Vault) SetPolicies(v []string) { - o.Policies = &v + o.Policies = v } func (o Vault) MarshalJSON() ([]byte, error) { diff --git a/clients/go/v1/model_volume_mount.go b/clients/go/v1/model_volume_mount.go index 0adcbdda..f6b67a92 100644 --- a/clients/go/v1/model_volume_mount.go +++ b/clients/go/v1/model_volume_mount.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/model_volume_request.go b/clients/go/v1/model_volume_request.go index c2079272..7ecac298 100644 --- a/clients/go/v1/model_volume_request.go +++ b/clients/go/v1/model_volume_request.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ import ( type VolumeRequest struct { AccessMode *string `json:"AccessMode,omitempty"` AttachmentMode *string `json:"AttachmentMode,omitempty"` - MountOptions *CSIMountOptions `json:"MountOptions,omitempty"` + MountOptions NullableCSIMountOptions `json:"MountOptions,omitempty"` Name *string `json:"Name,omitempty"` PerAlloc *bool `json:"PerAlloc,omitempty"` ReadOnly *bool `json:"ReadOnly,omitempty"` @@ -108,36 +108,46 @@ func (o *VolumeRequest) SetAttachmentMode(v string) { o.AttachmentMode = &v } -// GetMountOptions returns the MountOptions field value if set, zero value otherwise. +// GetMountOptions returns the MountOptions field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VolumeRequest) GetMountOptions() CSIMountOptions { - if o == nil || o.MountOptions == nil { + if o == nil || o.MountOptions.Get() == nil { var ret CSIMountOptions return ret } - return *o.MountOptions + return *o.MountOptions.Get() } // GetMountOptionsOk returns a tuple with the MountOptions field value if set, nil otherwise // 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 *VolumeRequest) GetMountOptionsOk() (*CSIMountOptions, bool) { - if o == nil || o.MountOptions == nil { + if o == nil { return nil, false } - return o.MountOptions, true + return o.MountOptions.Get(), o.MountOptions.IsSet() } // HasMountOptions returns a boolean if a field has been set. func (o *VolumeRequest) HasMountOptions() bool { - if o != nil && o.MountOptions != nil { + if o != nil && o.MountOptions.IsSet() { return true } return false } -// SetMountOptions gets a reference to the given CSIMountOptions and assigns it to the MountOptions field. +// SetMountOptions gets a reference to the given NullableCSIMountOptions and assigns it to the MountOptions field. func (o *VolumeRequest) SetMountOptions(v CSIMountOptions) { - o.MountOptions = &v + o.MountOptions.Set(&v) +} +// SetMountOptionsNil sets the value for MountOptions to be an explicit nil +func (o *VolumeRequest) SetMountOptionsNil() { + o.MountOptions.Set(nil) +} + +// UnsetMountOptions ensures that no value is present for MountOptions, not even an explicit nil +func (o *VolumeRequest) UnsetMountOptions() { + o.MountOptions.Unset() } // GetName returns the Name field value if set, zero value otherwise. @@ -308,8 +318,8 @@ func (o VolumeRequest) MarshalJSON() ([]byte, error) { if o.AttachmentMode != nil { toSerialize["AttachmentMode"] = o.AttachmentMode } - if o.MountOptions != nil { - toSerialize["MountOptions"] = o.MountOptions + if o.MountOptions.IsSet() { + toSerialize["MountOptions"] = o.MountOptions.Get() } if o.Name != nil { toSerialize["Name"] = o.Name diff --git a/clients/go/v1/model_wait_config.go b/clients/go/v1/model_wait_config.go index 337764e2..884e1550 100644 --- a/clients/go/v1/model_wait_config.go +++ b/clients/go/v1/model_wait_config.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/response.go b/clients/go/v1/response.go index 3f15ab50..628fe729 100644 --- a/clients/go/v1/response.go +++ b/clients/go/v1/response.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/go/v1/utils.go b/clients/go/v1/utils.go index e72b3d96..dfd8243d 100644 --- a/clients/go/v1/utils.go +++ b/clients/go/v1/utils.go @@ -1,11 +1,11 @@ /* - * Nomad - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.4 - * Contact: support@hashicorp.com - */ +Nomad + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.4 +Contact: support@hashicorp.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/java/v1/.github/workflows/maven.yml b/clients/java/v1/.github/workflows/maven.yml new file mode 100644 index 00000000..c91d3e28 --- /dev/null +++ b/clients/java/v1/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Nomad + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/clients/java/v1/.openapi-generator/FILES b/clients/java/v1/.openapi-generator/FILES index 22072e44..6098bccd 100644 --- a/clients/java/v1/.openapi-generator/FILES +++ b/clients/java/v1/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore README.md api/openapi.yaml @@ -256,6 +257,7 @@ src/main/java/io/nomadproject/client/models/ACLPolicy.java src/main/java/io/nomadproject/client/models/ACLPolicyListStub.java src/main/java/io/nomadproject/client/models/ACLToken.java src/main/java/io/nomadproject/client/models/ACLTokenListStub.java +src/main/java/io/nomadproject/client/models/AbstractOpenApiSchema.java src/main/java/io/nomadproject/client/models/Affinity.java src/main/java/io/nomadproject/client/models/AllocDeploymentStatus.java src/main/java/io/nomadproject/client/models/AllocStopResponse.java diff --git a/clients/java/v1/.openapi-generator/VERSION b/clients/java/v1/.openapi-generator/VERSION index 7cbea073..f4965a31 100644 --- a/clients/java/v1/.openapi-generator/VERSION +++ b/clients/java/v1/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0 \ No newline at end of file +6.0.0 \ No newline at end of file diff --git a/clients/java/v1/README.md b/clients/java/v1/README.md index c8e310c7..afbc6153 100644 --- a/clients/java/v1/README.md +++ b/clients/java/v1/README.md @@ -12,8 +12,8 @@ No description provided (generated by Openapi Generator https://github.com/opena ## Requirements Building the API client library requires: -1. Java 1.7+ -2. Maven/Gradle +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) ## Installation @@ -49,7 +49,14 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.nomadproject:nomad-openapi-java-client:1.1.4" + repositories { + mavenCentral() // Needed if the 'nomad-openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'nomad-openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "io.nomadproject:nomad-openapi-java-client:1.1.4" + } ``` ### Others diff --git a/clients/java/v1/api/openapi.yaml b/clients/java/v1/api/openapi.yaml index ede31d1c..d5a08e27 100644 --- a/clients/java/v1/api/openapi.yaml +++ b/clients/java/v1/api/openapi.yaml @@ -9,7 +9,7 @@ info: version: 1.1.4 servers: - description: dev-agent - url: '{scheme}://{address}:{port}/v1' + url: "{scheme}://{address}:{port}/v1" variables: address: default: 127.0.0.1 @@ -21,7 +21,7 @@ servers: - https - http - description: agent - url: '{scheme}://{address}:{port}/v1' + url: "{scheme}://{address}:{port}/v1" variables: address: default: 127.0.0.1 @@ -77,6 +77,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -119,8 +120,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -136,7 +137,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -184,6 +185,7 @@ paths: items: $ref: '#/components/schemas/ACLPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -265,6 +267,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -306,8 +309,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -323,7 +326,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -377,6 +380,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -463,6 +467,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -484,7 +489,7 @@ paths: - X-Nomad-Token: [] tags: - ACL - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /acl/token: get: @@ -506,8 +511,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -523,7 +528,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -569,6 +574,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -650,6 +656,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -691,8 +698,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -708,7 +715,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -762,6 +769,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -852,6 +860,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -873,7 +882,7 @@ paths: - X-Nomad-Token: [] tags: - ACL - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /acl/token/onetime: post: @@ -917,6 +926,7 @@ paths: application/json: schema: $ref: '#/components/schemas/OneTimeToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -987,6 +997,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1008,7 +1019,7 @@ paths: - X-Nomad-Token: [] tags: - ACL - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /acl/tokens: get: @@ -1030,8 +1041,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1047,7 +1058,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1095,6 +1106,7 @@ paths: items: $ref: '#/components/schemas/ACLTokenListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1150,8 +1162,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1167,7 +1179,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1221,6 +1233,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Allocation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1276,8 +1289,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1293,7 +1306,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1349,6 +1362,7 @@ paths: items: $ref: '#/components/schemas/ServiceRegistration' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1404,8 +1418,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1421,7 +1435,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1484,6 +1498,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AllocStopResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1526,8 +1541,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1543,7 +1558,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1607,6 +1622,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1662,8 +1678,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1679,7 +1695,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1733,6 +1749,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -1824,6 +1841,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -1836,7 +1854,7 @@ paths: - X-Nomad-Token: [] tags: - Deployments - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /deployment/allocations/{deploymentID}: get: @@ -1858,8 +1876,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -1875,7 +1893,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -1931,6 +1949,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2016,6 +2035,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2085,6 +2105,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2097,7 +2118,7 @@ paths: - X-Nomad-Token: [] tags: - Deployments - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /deployment/promote/{deploymentID}: post: @@ -2155,6 +2176,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2167,7 +2189,7 @@ paths: - X-Nomad-Token: [] tags: - Deployments - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /deployment/unblock/{deploymentID}: post: @@ -2225,6 +2247,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" "400": description: Bad request "403": @@ -2237,7 +2260,7 @@ paths: - X-Nomad-Token: [] tags: - Deployments - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /deployments: get: @@ -2259,8 +2282,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2276,7 +2299,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2324,6 +2347,7 @@ paths: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2379,8 +2403,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2396,7 +2420,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2450,6 +2474,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Evaluation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2505,8 +2530,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2522,7 +2547,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2578,6 +2603,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2633,8 +2659,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2650,7 +2676,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2698,6 +2724,7 @@ paths: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2801,6 +2828,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobDeregisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -2842,8 +2870,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -2859,7 +2887,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -2913,6 +2941,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Job' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3003,6 +3032,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3037,7 +3067,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/allocations: get: @@ -3059,8 +3089,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3076,7 +3106,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3142,6 +3172,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3197,8 +3228,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3214,7 +3245,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3268,6 +3299,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3323,8 +3355,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3340,7 +3372,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3405,6 +3437,7 @@ paths: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3496,6 +3529,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobDispatchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3517,7 +3551,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/evaluate: post: @@ -3575,6 +3609,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3596,7 +3631,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/evaluations: get: @@ -3618,8 +3653,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3635,7 +3670,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -3691,6 +3726,7 @@ paths: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3776,6 +3812,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PeriodicForceResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3854,6 +3891,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobPlanResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3875,7 +3913,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/revert: post: @@ -3933,6 +3971,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -3954,7 +3993,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/scale: get: @@ -3976,8 +4015,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -3993,7 +4032,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4047,6 +4086,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobScaleStatusResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4137,6 +4177,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4158,7 +4199,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/stable: post: @@ -4216,6 +4257,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobStabilityResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4237,7 +4279,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /job/{jobName}/summary: get: @@ -4259,8 +4301,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4276,7 +4318,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4330,6 +4372,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobSummary' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4385,8 +4428,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4402,7 +4445,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4464,6 +4507,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobVersionsResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4519,8 +4563,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4536,7 +4580,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4584,6 +4628,7 @@ paths: items: $ref: '#/components/schemas/JobListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4666,6 +4711,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4700,7 +4746,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /jobs/parse: post: @@ -4717,6 +4763,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Job' + description: "" "400": description: Bad request "403": @@ -4727,7 +4774,7 @@ paths: description: Internal server error tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /metrics: get: @@ -4747,6 +4794,7 @@ paths: application/json: schema: $ref: '#/components/schemas/MetricsSummary' + description: "" "400": description: Bad request "403": @@ -4796,6 +4844,7 @@ paths: style: form responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4864,6 +4913,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -4905,8 +4955,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -4922,7 +4972,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -4976,6 +5026,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Namespace' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5062,6 +5113,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5083,7 +5135,7 @@ paths: - X-Nomad-Token: [] tags: - Namespaces - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /namespaces: get: @@ -5105,8 +5157,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5122,7 +5174,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5170,6 +5222,7 @@ paths: items: $ref: '#/components/schemas/Namespace' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5225,8 +5278,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5242,7 +5295,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5296,6 +5349,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Node' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5351,8 +5405,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5368,7 +5422,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5424,6 +5478,7 @@ paths: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5479,8 +5534,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5496,7 +5551,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5556,6 +5611,7 @@ paths: application/json: schema: $ref: '#/components/schemas/NodeDrainUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5577,7 +5633,7 @@ paths: - X-Nomad-Token: [] tags: - Nodes - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /node/{nodeId}/eligibility: post: @@ -5599,8 +5655,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5616,7 +5672,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5676,6 +5732,7 @@ paths: application/json: schema: $ref: '#/components/schemas/NodeEligibilityUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5697,7 +5754,7 @@ paths: - X-Nomad-Token: [] tags: - Nodes - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /node/{nodeId}/purge: post: @@ -5719,8 +5776,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5736,7 +5793,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5790,6 +5847,7 @@ paths: application/json: schema: $ref: '#/components/schemas/NodePurgeResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5832,8 +5890,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5849,7 +5907,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -5906,6 +5964,7 @@ paths: items: $ref: '#/components/schemas/NodeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -5961,8 +6020,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -5978,7 +6037,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6024,6 +6083,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AutopilotConfiguration' + description: "" "400": description: Bad request "403": @@ -6084,6 +6144,7 @@ paths: application/json: schema: type: boolean + description: "" "400": description: Bad request "403": @@ -6096,7 +6157,7 @@ paths: - X-Nomad-Token: [] tags: - Operator - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /operator/autopilot/health: get: @@ -6118,8 +6179,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6135,7 +6196,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6181,6 +6242,7 @@ paths: application/json: schema: $ref: '#/components/schemas/OperatorHealthReply' + description: "" "400": description: Bad request "403": @@ -6214,8 +6276,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6231,7 +6293,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6277,6 +6339,7 @@ paths: application/json: schema: $ref: '#/components/schemas/RaftConfiguration' + description: "" "400": description: Bad request "403": @@ -6327,7 +6390,8 @@ paths: type: string style: form responses: - "200": {} + "200": + description: "" "400": description: Bad request "403": @@ -6361,8 +6425,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6378,7 +6442,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6424,6 +6488,7 @@ paths: application/json: schema: $ref: '#/components/schemas/SchedulerConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6506,6 +6571,7 @@ paths: application/json: schema: $ref: '#/components/schemas/SchedulerSetConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6527,7 +6593,7 @@ paths: - X-Nomad-Token: [] tags: - Operator - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /plugin/csi/{pluginID}: get: @@ -6549,8 +6615,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6566,7 +6632,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6622,6 +6688,7 @@ paths: items: $ref: '#/components/schemas/CSIPlugin' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6677,8 +6744,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6694,7 +6761,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6742,6 +6809,7 @@ paths: items: $ref: '#/components/schemas/CSIPluginListStub' type: array + description: "" "400": description: Bad request "403": @@ -6799,6 +6867,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6820,7 +6889,7 @@ paths: - X-Nomad-Token: [] tags: - Enterprise - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /quota/{specName}: delete: @@ -6868,6 +6937,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -6909,8 +6979,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -6926,7 +6996,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -6980,6 +7050,7 @@ paths: application/json: schema: $ref: '#/components/schemas/QuotaSpec' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7066,6 +7137,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7087,7 +7159,7 @@ paths: - X-Nomad-Token: [] tags: - Enterprise - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /quotas: get: @@ -7109,8 +7181,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7126,7 +7198,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7173,6 +7245,7 @@ paths: schema: items: {} type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7219,6 +7292,7 @@ paths: items: type: string type: array + description: "" "400": description: Bad request "403": @@ -7250,8 +7324,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7267,7 +7341,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7315,6 +7389,7 @@ paths: items: $ref: '#/components/schemas/ScalingPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7370,8 +7445,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7387,7 +7462,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7441,6 +7516,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ScalingPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7496,8 +7572,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7513,7 +7589,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7565,6 +7641,7 @@ paths: application/json: schema: $ref: '#/components/schemas/SearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7599,7 +7676,7 @@ paths: - X-Nomad-Token: [] tags: - Search - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /search/fuzzy: post: @@ -7621,8 +7698,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7638,7 +7715,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7690,6 +7767,7 @@ paths: application/json: schema: $ref: '#/components/schemas/FuzzySearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -7724,7 +7802,7 @@ paths: - X-Nomad-Token: [] tags: - Search - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /status/leader: get: @@ -7746,8 +7824,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7763,7 +7841,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7809,6 +7887,7 @@ paths: application/json: schema: type: string + description: "" "400": description: Bad request "403": @@ -7842,8 +7921,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -7859,7 +7938,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -7907,6 +7986,7 @@ paths: items: type: string type: array + description: "" "400": description: Bad request "403": @@ -7957,7 +8037,8 @@ paths: type: string style: form responses: - "200": {} + "200": + description: "" "400": description: Bad request "403": @@ -8008,7 +8089,8 @@ paths: type: string style: form responses: - "200": {} + "200": + description: "" "400": description: Bad request "403": @@ -8070,6 +8152,7 @@ paths: application/json: schema: $ref: '#/components/schemas/JobValidateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8091,7 +8174,7 @@ paths: - X-Nomad-Token: [] tags: - Jobs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /volume/csi/{volumeId}: delete: @@ -8147,6 +8230,7 @@ paths: style: form responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8188,8 +8272,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8205,7 +8289,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8259,6 +8343,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSIVolume' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8345,6 +8430,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8366,7 +8452,7 @@ paths: - X-Nomad-Token: [] tags: - Volumes - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /volume/csi/{volumeId}/{action}: delete: @@ -8420,7 +8506,7 @@ paths: schema: type: string style: form - - description: The action to perform on the Volume (create, detach, delete). + - description: "The action to perform on the Volume (create, detach, delete)." explode: false in: path name: action @@ -8430,6 +8516,7 @@ paths: style: simple responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8508,7 +8595,7 @@ paths: schema: type: string style: simple - - description: The action to perform on the Volume (create, detach, delete). + - description: "The action to perform on the Volume (create, detach, delete)." explode: false in: path name: action @@ -8524,6 +8611,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8558,7 +8646,7 @@ paths: - X-Nomad-Token: [] tags: - Volumes - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /volumes: get: @@ -8580,8 +8668,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8597,7 +8685,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8669,6 +8757,7 @@ paths: items: $ref: '#/components/schemas/CSIVolumeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8747,6 +8836,7 @@ paths: required: true responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8781,7 +8871,7 @@ paths: - X-Nomad-Token: [] tags: - Volumes - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /volumes/external: get: @@ -8803,8 +8893,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -8820,7 +8910,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -8874,6 +8964,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSIVolumeListExternalResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -8963,6 +9054,7 @@ paths: style: form responses: "200": + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -9004,8 +9096,8 @@ paths: schema: type: string style: form - - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + - description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -9021,7 +9113,7 @@ paths: schema: type: string style: form - - description: If present, results will include stale reads. + - description: "If present, results will include stale reads." explode: true in: query name: stale @@ -9075,6 +9167,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSISnapshotListResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -9157,6 +9250,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CSISnapshotCreateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the @@ -9178,7 +9272,7 @@ paths: - X-Nomad-Token: [] tags: - Volumes - x-contentType: application/json + x-content-type: application/json x-accepts: application/json components: parameters: @@ -9274,8 +9368,8 @@ components: type: string style: form IndexHeader: - description: If set, wait until query exceeds given index. Must be provided - with WaitParam. + description: "If set, wait until query exceeds given index. Must be provided\ + \ with WaitParam." explode: false in: header name: index @@ -9460,7 +9554,7 @@ components: type: string style: form StaleParam: - description: If present, results will include stale reads. + description: "If present, results will include stale reads." explode: true in: query name: stale @@ -9469,7 +9563,7 @@ components: type: string style: form VolumeActionParam: - description: The action to perform on the Volume (create, detach, delete). + description: "The action to perform on the Volume (create, detach, delete)." explode: false in: path name: action @@ -9707,6 +9801,7 @@ components: BadRequestResponse: description: Bad request CreateNamespaceResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9716,6 +9811,7 @@ components: type: integer style: simple CreateQuotaSpecResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9725,6 +9821,7 @@ components: type: integer style: simple DeleteACLPolicyResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9734,6 +9831,7 @@ components: type: integer style: simple DeleteACLTokenResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9747,6 +9845,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobDeregisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9756,6 +9855,7 @@ components: type: integer style: simple DeleteNamespaceResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9764,8 +9864,10 @@ components: schema: type: integer style: simple - DeleteOperatorRaftPeerResponse: {} + DeleteOperatorRaftPeerResponse: + description: "" DeleteSnapshotResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9775,6 +9877,7 @@ components: type: integer style: simple DeleteVolumeRegistrationResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9784,6 +9887,7 @@ components: type: integer style: simple DetachOrDeleteVolumeResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9814,6 +9918,7 @@ components: items: $ref: '#/components/schemas/ACLPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9840,6 +9945,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9866,6 +9972,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9892,6 +9999,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9920,6 +10028,7 @@ components: items: $ref: '#/components/schemas/ACLTokenListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9946,6 +10055,7 @@ components: application/json: schema: $ref: '#/components/schemas/Allocation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -9974,6 +10084,7 @@ components: items: $ref: '#/components/schemas/ServiceRegistration' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10002,6 +10113,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10030,6 +10142,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10056,6 +10169,7 @@ components: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10084,6 +10198,7 @@ components: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10112,6 +10227,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10138,6 +10254,7 @@ components: application/json: schema: $ref: '#/components/schemas/Evaluation' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10166,6 +10283,7 @@ components: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10192,6 +10310,7 @@ components: application/json: schema: $ref: '#/components/schemas/CSIVolumeListExternalResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10218,6 +10337,7 @@ components: application/json: schema: $ref: '#/components/schemas/FuzzySearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10246,6 +10366,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10272,6 +10393,7 @@ components: application/json: schema: $ref: '#/components/schemas/Deployment' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10300,6 +10422,7 @@ components: items: $ref: '#/components/schemas/Deployment' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10328,6 +10451,7 @@ components: items: $ref: '#/components/schemas/Evaluation' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10354,6 +10478,7 @@ components: application/json: schema: $ref: '#/components/schemas/Job' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10380,6 +10505,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobScaleStatusResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10406,6 +10532,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobSummary' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10432,6 +10559,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobVersionsResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10460,6 +10588,7 @@ components: items: $ref: '#/components/schemas/JobListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10486,11 +10615,13 @@ components: application/json: schema: $ref: '#/components/schemas/MetricsSummary' + description: "" GetNamespaceResponse: content: application/json: schema: $ref: '#/components/schemas/Namespace' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10519,6 +10650,7 @@ components: items: $ref: '#/components/schemas/Namespace' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10547,6 +10679,7 @@ components: items: $ref: '#/components/schemas/AllocationListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10573,6 +10706,7 @@ components: application/json: schema: $ref: '#/components/schemas/Node' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10601,6 +10735,7 @@ components: items: $ref: '#/components/schemas/NodeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10627,21 +10762,25 @@ components: application/json: schema: $ref: '#/components/schemas/AutopilotConfiguration' + description: "" GetOperatorAutopilotHealthResponse: content: application/json: schema: $ref: '#/components/schemas/OperatorHealthReply' + description: "" GetOperatorRaftConfigurationResponse: content: application/json: schema: $ref: '#/components/schemas/RaftConfiguration' + description: "" GetOperatorSchedulerConfigurationResponse: content: application/json: schema: $ref: '#/components/schemas/SchedulerConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10670,6 +10809,7 @@ components: items: $ref: '#/components/schemas/CSIPlugin' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10698,11 +10838,13 @@ components: items: $ref: '#/components/schemas/CSIPluginListStub' type: array + description: "" GetQuotaSpecResponse: content: application/json: schema: $ref: '#/components/schemas/QuotaSpec' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10730,6 +10872,7 @@ components: schema: items: {} type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10758,6 +10901,7 @@ components: items: type: string type: array + description: "" GetScalingPoliciesResponse: content: application/json: @@ -10765,6 +10909,7 @@ components: items: $ref: '#/components/schemas/ScalingPolicyListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10791,6 +10936,7 @@ components: application/json: schema: $ref: '#/components/schemas/ScalingPolicy' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10817,6 +10963,7 @@ components: application/json: schema: $ref: '#/components/schemas/SearchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10843,6 +10990,7 @@ components: application/json: schema: $ref: '#/components/schemas/CSISnapshotListResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10869,6 +11017,7 @@ components: application/json: schema: type: string + description: "" GetStatusPeersResponse: content: application/json: @@ -10876,11 +11025,13 @@ components: items: type: string type: array + description: "" GetVolumeResponse: content: application/json: schema: $ref: '#/components/schemas/CSIVolume' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10909,6 +11060,7 @@ components: items: $ref: '#/components/schemas/CSIVolumeListStub' type: array + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10939,6 +11091,7 @@ components: application/json: schema: $ref: '#/components/schemas/NodeDrainUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10952,6 +11105,7 @@ components: application/json: schema: $ref: '#/components/schemas/NodeEligibilityUpdateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10965,6 +11119,7 @@ components: application/json: schema: $ref: '#/components/schemas/NodePurgeResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10978,6 +11133,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -10987,6 +11143,7 @@ components: type: integer style: simple PostACLPolicyResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11000,6 +11157,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11013,6 +11171,7 @@ components: application/json: schema: $ref: '#/components/schemas/OneTimeToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11026,6 +11185,7 @@ components: application/json: schema: $ref: '#/components/schemas/ACLToken' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11039,6 +11199,7 @@ components: application/json: schema: $ref: '#/components/schemas/AllocStopResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11052,31 +11213,37 @@ components: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentFailResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentPauseResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentPromoteResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostDeploymentUnblockResponse: content: application/json: schema: $ref: '#/components/schemas/DeploymentUpdateResponse' + description: "" PostJobDispatchResponse: content: application/json: schema: $ref: '#/components/schemas/JobDispatchResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11090,6 +11257,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11103,11 +11271,13 @@ components: application/json: schema: $ref: '#/components/schemas/Job' + description: "" PostJobPeriodicForceResponse: content: application/json: schema: $ref: '#/components/schemas/PeriodicForceResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11121,6 +11291,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobPlanResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11134,6 +11305,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11160,6 +11332,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11173,6 +11346,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11186,6 +11360,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobStabilityResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11199,6 +11374,7 @@ components: application/json: schema: $ref: '#/components/schemas/JobValidateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11208,6 +11384,7 @@ components: type: integer style: simple PostNamespaceResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11221,6 +11398,7 @@ components: application/json: schema: $ref: '#/components/schemas/SchedulerSetConfigurationResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11230,6 +11408,7 @@ components: type: integer style: simple PostQuotaSpecResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11243,6 +11422,7 @@ components: application/json: schema: $ref: '#/components/schemas/CSISnapshotCreateResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11252,6 +11432,7 @@ components: type: integer style: simple PostVolumeRegistrationResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11261,6 +11442,7 @@ components: type: integer style: simple PostVolumeResponse: + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11287,13 +11469,17 @@ components: application/json: schema: type: boolean - PutSystemGCResponse: {} - PutSystemReconcileSummariesResponse: {} + description: "" + PutSystemGCResponse: + description: "" + PutSystemReconcileSummariesResponse: + description: "" RegisterJobResponse: content: application/json: schema: $ref: '#/components/schemas/JobRegisterResponse' + description: "" headers: X-Nomad-Index: description: A unique identifier representing the current state of the requested @@ -11315,7 +11501,8 @@ components: schema: type: integer style: simple - default: {} + default: + description: "" schemas: ACLPolicy: example: @@ -11324,15 +11511,16 @@ components: Rules: Rules ModifyIndex: 2147483647 Name: Name + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11346,15 +11534,16 @@ components: Description: Description ModifyIndex: 2147483647 Name: Name + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11373,20 +11562,22 @@ components: Global: true ModifyIndex: 2147483647 Name: Name + nullable: true properties: AccessorID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: format: date-time + nullable: true type: string Global: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11412,20 +11603,22 @@ components: Global: true ModifyIndex: 2147483647 Name: Name + nullable: true properties: AccessorID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: format: date-time + nullable: true type: string Global: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -11443,6 +11636,7 @@ components: RTarget: RTarget Operand: Operand Weight: -101 + nullable: true properties: LTarget: type: string @@ -11461,34 +11655,38 @@ components: Timestamp: 2000-01-23T04:56:07.000+00:00 Healthy: true ModifyIndex: 2147483647 + nullable: true properties: Canary: type: boolean Healthy: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Timestamp: format: date-time + nullable: true type: string type: object AllocStopResponse: example: Index: 2147483647 EvalID: EvalID + nullable: true properties: EvalID: type: string Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object AllocatedCpuResources: example: CpuShares: 9 + nullable: true properties: CpuShares: format: int64 @@ -11502,6 +11700,7 @@ components: Type: Type Vendor: Vendor Name: Name + nullable: true properties: DeviceIDs: items: @@ -11518,6 +11717,7 @@ components: example: MemoryMB: 3 MemoryMaxMB: 2 + nullable: true properties: MemoryMB: format: int64 @@ -11697,6 +11897,7 @@ components: Label: Label Value: 7 To: 2 + nullable: true properties: Shared: $ref: '#/components/schemas/AllocatedSharedResources' @@ -11786,6 +11987,7 @@ components: Label: Label Value: 7 To: 2 + nullable: true properties: DiskMB: format: int64 @@ -11888,6 +12090,7 @@ components: Type: Type Vendor: Vendor Name: Name + nullable: true properties: Cpu: $ref: '#/components/schemas/AllocatedCpuResources' @@ -17756,9 +17959,10 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: AllocModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer AllocatedResources: @@ -17768,7 +17972,7 @@ components: ClientStatus: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -17797,7 +18001,7 @@ components: Metrics: $ref: '#/components/schemas/AllocationMetric' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -18112,6 +18316,7 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: AllocatedResources: $ref: '#/components/schemas/AllocatedResources' @@ -18120,7 +18325,7 @@ components: ClientStatus: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -18143,11 +18348,11 @@ components: JobType: type: string JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -18321,6 +18526,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: AllocationTime: format: int64 @@ -18378,6 +18584,7 @@ components: String: String Unit: Unit Int: 2 + nullable: true properties: Bool: type: boolean @@ -18404,11 +18611,12 @@ components: EnableRedundancyZones: true ModifyIndex: 2147483647 CleanupDeadServers: true + nullable: true properties: CleanupDeadServers: type: boolean CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer DisableUpgradeMigration: @@ -18420,14 +18628,14 @@ components: LastContactThreshold: type: string MaxTrailingLogs: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer MinQuorum: minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ServerStabilizationTime: @@ -18447,6 +18655,7 @@ components: SupportsExpand: true SupportsGet: true SupportsCondition: true + nullable: true properties: SupportsAttachDetach: type: boolean @@ -18505,6 +18714,7 @@ components: SupportsCondition: true Healthy: true RequiresControllerPlugin: true + nullable: true properties: AllocID: type: string @@ -18524,6 +18734,7 @@ components: type: boolean UpdateTime: format: date-time + nullable: true type: string type: object CSIMountOptions: @@ -18532,6 +18743,7 @@ components: - MountFlags - MountFlags FSType: FSType + nullable: true properties: FSType: type: string @@ -18551,6 +18763,7 @@ components: key: Segments SupportsCondition: true SupportsStats: true + nullable: true properties: AccessibleTopology: $ref: '#/components/schemas/CSITopology' @@ -19185,6 +19398,7 @@ components: Version: Version ID: ID ModifyIndex: 2147483647 + nullable: true properties: Allocations: items: @@ -19201,13 +19415,13 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Nodes: @@ -19234,6 +19448,7 @@ components: ID: ID ModifyIndex: 2147483647 Provider: Provider + nullable: true properties: ControllerRequired: type: boolean @@ -19242,13 +19457,13 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NodesExpected: @@ -19278,6 +19493,7 @@ components: SourceVolumeID: SourceVolumeID ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name + nullable: true properties: CreateTime: format: int64 @@ -19336,6 +19552,7 @@ components: ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -19380,6 +19597,7 @@ components: SourceVolumeID: SourceVolumeID ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name + nullable: true properties: KnownLeader: type: boolean @@ -19387,7 +19605,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -19432,6 +19650,7 @@ components: SourceVolumeID: SourceVolumeID ExternalSourceVolumeID: ExternalSourceVolumeID Name: Name + nullable: true properties: KnownLeader: type: boolean @@ -19439,7 +19658,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -19456,6 +19675,7 @@ components: example: Segments: key: Segments + nullable: true properties: Segments: additionalProperties: @@ -19474,6 +19694,7 @@ components: key: Segments - Segments: key: Segments + nullable: true properties: Preferred: items: @@ -31790,6 +32011,7 @@ components: FSType: FSType ModifyIndex: 2147483647 ProviderVersion: ProviderVersion + nullable: true properties: AccessMode: type: string @@ -31815,7 +32037,7 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ExternalID: @@ -31823,7 +32045,7 @@ components: ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer MountOptions: @@ -31864,6 +32086,7 @@ components: $ref: '#/components/schemas/CSITopologyRequest' ResourceExhausted: format: date-time + nullable: true type: string Schedulable: type: boolean @@ -31890,6 +32113,7 @@ components: example: AccessMode: AccessMode AttachmentMode: AttachmentMode + nullable: true properties: AccessMode: type: string @@ -56510,6 +56734,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -56535,6 +56760,7 @@ components: PublishedExternalNodeIDs: - PublishedExternalNodeIDs - PublishedExternalNodeIDs + nullable: true properties: CapacityBytes: format: int64 @@ -56584,6 +56810,7 @@ components: - PublishedExternalNodeIDs - PublishedExternalNodeIDs NextToken: NextToken + nullable: true properties: NextToken: type: string @@ -56616,6 +56843,7 @@ components: ID: ID AttachmentMode: AttachmentMode ModifyIndex: 2147483647 + nullable: true properties: AccessMode: type: string @@ -56628,7 +56856,7 @@ components: ControllersHealthy: type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ExternalID: @@ -56636,7 +56864,7 @@ components: ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -56653,6 +56881,7 @@ components: type: string ResourceExhausted: format: date-time + nullable: true type: string Schedulable: type: boolean @@ -81275,6 +81504,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -81292,6 +81522,7 @@ components: Grace: 0 IgnoreWarnings: true Limit: 4 + nullable: true properties: Grace: format: int64 @@ -81306,6 +81537,7 @@ components: LTarget: LTarget RTarget: RTarget Operand: Operand + nullable: true properties: LTarget: type: string @@ -81317,6 +81549,7 @@ components: Consul: example: Namespace: Namespace + nullable: true properties: Namespace: type: string @@ -81546,6 +81779,7 @@ components: MaxFiles: 4 MaxFileSizeMB: 1 Name: Name + nullable: true properties: Gateway: $ref: '#/components/schemas/ConsulGateway' @@ -81567,6 +81801,7 @@ components: ListenerPort: ListenerPort Protocol: Protocol LocalPathPort: 4 + nullable: true properties: Path: items: @@ -81579,6 +81814,7 @@ components: ListenerPort: ListenerPort Protocol: Protocol LocalPathPort: 4 + nullable: true properties: ListenerPort: type: string @@ -81661,6 +81897,7 @@ components: Address: Address Port: 3 Name: Name + nullable: true properties: Address: type: string @@ -81682,6 +81919,7 @@ components: Address: Address Port: 3 Name: Name + nullable: true properties: Config: additionalProperties: {} @@ -81708,6 +81946,7 @@ components: - CipherSuites - CipherSuites TLSMaxVersion: TLSMaxVersion + nullable: true properties: CipherSuites: items: @@ -81773,6 +82012,7 @@ components: Name: Name Port: 7 Protocol: Protocol + nullable: true properties: Port: type: integer @@ -81789,6 +82029,7 @@ components: - Hosts - Hosts Name: Name + nullable: true properties: Hosts: items: @@ -81804,6 +82045,7 @@ components: KeyFile: KeyFile Name: Name SNI: SNI + nullable: true properties: CAFile: type: string @@ -81820,6 +82062,7 @@ components: ConsulMeshGateway: example: Mode: Mode + nullable: true properties: Mode: type: string @@ -81855,6 +82098,7 @@ components: Mode: Mode LocalBindAddress: LocalBindAddress LocalServicePort: 0 + nullable: true properties: Config: additionalProperties: {} @@ -81907,6 +82151,7 @@ components: Tags: - Tags - Tags + nullable: true properties: DisableDefaultTCPCheck: type: boolean @@ -81932,6 +82177,7 @@ components: KeyFile: KeyFile Name: Name SNI: SNI + nullable: true properties: Services: items: @@ -81947,6 +82193,7 @@ components: MeshGateway: Mode: Mode LocalBindAddress: LocalBindAddress + nullable: true properties: Datacenter: type: string @@ -81974,6 +82221,7 @@ components: Servers: - Servers - Servers + nullable: true properties: Options: items: @@ -82016,9 +82264,10 @@ components: JobVersion: 2147483647 JobID: JobID ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ID: @@ -82026,25 +82275,25 @@ components: IsMultiregion: type: boolean JobCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobSpecModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -82070,6 +82319,7 @@ components: UnhealthyAllocationIDs: - UnhealthyAllocationIDs - UnhealthyAllocationIDs + nullable: true properties: DeploymentID: type: string @@ -82095,6 +82345,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: DeploymentID: type: string @@ -82117,6 +82368,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: All: type: boolean @@ -82147,6 +82399,7 @@ components: - PlacedCanaries UnhealthyAllocs: 7 AutoRevert: true + nullable: true properties: AutoRevert: type: boolean @@ -82169,6 +82422,7 @@ components: type: boolean RequireProgressBy: format: date-time + nullable: true type: string UnhealthyAllocs: type: integer @@ -82179,6 +82433,7 @@ components: SecretID: SecretID Region: Region Namespace: Namespace + nullable: true properties: DeploymentID: type: string @@ -82197,26 +82452,27 @@ components: RequestTime: 5 RevertedJobVersion: 2147483647 EvalID: EvalID + nullable: true properties: DeploymentModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: format: int64 type: integer RevertedJobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -82240,43 +82496,45 @@ components: InPlaceUpdate: 2147483647 Place: 2147483647 DestructiveUpdate: 2147483647 + nullable: true properties: Canary: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer DestructiveUpdate: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Ignore: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer InPlaceUpdate: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Migrate: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Place: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Preemptions: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Stop: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object DispatchPayloadConfig: example: File: File + nullable: true properties: File: type: string @@ -82289,6 +82547,7 @@ components: StartedAt: 2000-01-23T04:56:07.000+00:00 UpdatedAt: 2000-01-23T04:56:07.000+00:00 AccessorID: AccessorID + nullable: true properties: AccessorID: type: string @@ -82298,17 +82557,20 @@ components: type: object StartedAt: format: date-time + nullable: true type: string Status: type: string UpdatedAt: format: date-time + nullable: true type: string type: object DrainSpec: example: IgnoreSystemJobs: true Deadline: 0 + nullable: true properties: Deadline: format: int64 @@ -82324,17 +82586,20 @@ components: IgnoreSystemJobs: true Deadline: 1 StartedAt: 2000-01-23T04:56:07.000+00:00 + nullable: true properties: Deadline: format: int64 type: integer ForceDeadline: format: date-time + nullable: true type: string IgnoreSystemJobs: type: boolean StartedAt: format: date-time + nullable: true type: string type: object DriverInfo: @@ -82345,6 +82610,7 @@ components: key: Attributes UpdateTime: 2000-01-23T04:56:07.000+00:00 Healthy: true + nullable: true properties: Attributes: additionalProperties: @@ -82358,6 +82624,7 @@ components: type: boolean UpdateTime: format: date-time + nullable: true type: string type: object Duration: @@ -82379,6 +82646,7 @@ components: EvalOptions: example: ForceReschedule: true + nullable: true properties: ForceReschedule: type: boolean @@ -82596,6 +82864,7 @@ components: Wait: 1 JobID: JobID ModifyIndex: 2147483647 + nullable: true properties: AnnotatePlan: type: boolean @@ -82606,7 +82875,7 @@ components: type: boolean type: object CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -82625,11 +82894,11 @@ components: JobID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -82642,7 +82911,7 @@ components: NodeID: type: string NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer PreviousEval: @@ -82660,7 +82929,7 @@ components: $ref: '#/components/schemas/EvaluationStub' type: array SnapshotIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Status: @@ -82676,6 +82945,7 @@ components: type: integer WaitUntil: format: date-time + nullable: true type: string type: object EvaluationStub: @@ -82698,11 +82968,12 @@ components: WaitUntil: 2000-01-23T04:56:07.000+00:00 JobID: JobID ModifyIndex: 2147483647 + nullable: true properties: BlockedEval: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer CreateTime: @@ -82715,7 +82986,7 @@ components: JobID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ModifyTime: @@ -82741,6 +83012,7 @@ components: type: string WaitUntil: format: date-time + nullable: true type: string type: object FieldDiff: @@ -82752,6 +83024,7 @@ components: - Annotations Old: Old Name: Name + nullable: true properties: Annotations: items: @@ -82772,6 +83045,7 @@ components: - Scope - Scope ID: ID + nullable: true properties: ID: type: string @@ -82799,6 +83073,7 @@ components: Region: Region WaitTime: 1 AllowStale: true + nullable: true properties: AllowStale: type: boolean @@ -82832,7 +83107,7 @@ components: Text: type: string WaitIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer WaitTime: @@ -82858,6 +83133,7 @@ components: LastIndex: 2147483647 RequestTime: 1 KnownLeader: true + nullable: true properties: KnownLeader: type: boolean @@ -82865,7 +83141,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Matches: @@ -82890,6 +83166,7 @@ components: Labels: key: Labels Name: Name + nullable: true properties: Labels: additionalProperties: @@ -82907,6 +83184,7 @@ components: CIDR: CIDR Interface: Interface Name: Name + nullable: true properties: CIDR: type: string @@ -82921,6 +83199,7 @@ components: example: Path: Path ReadOnly: true + nullable: true properties: Path: type: string @@ -88132,6 +88411,7 @@ components: Payload: Payload ModifyIndex: 2147483647 NomadTokenID: NomadTokenID + nullable: true properties: Affinities: items: @@ -88148,7 +88428,7 @@ components: ConsulToken: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenters: @@ -88162,7 +88442,7 @@ components: ID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Meta: @@ -88172,7 +88452,7 @@ components: Migrate: $ref: '#/components/schemas/MigrateStrategy' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Multiregion: @@ -88226,7 +88506,7 @@ components: VaultToken: type: string Version: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -88235,6 +88515,7 @@ components: Dead: 0 Running: 1 Pending: 6 + nullable: true properties: Dead: format: int64 @@ -88256,15 +88537,16 @@ components: EvalID: EvalID KnownLeader: true JobModifyIndex: 2147483647 + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer KnownLeader: @@ -88273,7 +88555,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -88709,6 +88991,7 @@ components: - null Name: Name ID: ID + nullable: true properties: Fields: items: @@ -88733,6 +89016,7 @@ components: key: Meta Payload: Payload JobID: JobID + nullable: true properties: JobID: type: string @@ -88752,21 +89036,22 @@ components: RequestTime: 5 JobCreateIndex: 2147483647 EvalID: EvalID + nullable: true properties: DispatchedJobID: type: string EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string JobCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -88781,6 +89066,7 @@ components: Region: Region JobID: JobID Namespace: Namespace + nullable: true properties: EvalOptions: $ref: '#/components/schemas/EvalOptions' @@ -88831,9 +89117,10 @@ components: - Datacenters ID: ID ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenters: @@ -88843,13 +89130,13 @@ components: ID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobSummary: $ref: '#/components/schemas/JobSummary' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -94087,6 +94374,7 @@ components: ModifyIndex: 2147483647 NomadTokenID: NomadTokenID Namespace: Namespace + nullable: true properties: Diff: type: boolean @@ -95652,6 +95940,7 @@ components: ModifyIndex: 2147483647 Warnings: Warnings JobModifyIndex: 2147483647 + nullable: true properties: Annotations: $ref: '#/components/schemas/PlanAnnotations' @@ -95666,11 +95955,12 @@ components: $ref: '#/components/schemas/AllocationMetric' type: object JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextPeriodicLaunch: format: date-time + nullable: true type: string Warnings: type: string @@ -100889,6 +101179,7 @@ components: NomadTokenID: NomadTokenID Namespace: Namespace JobModifyIndex: 2147483647 + nullable: true properties: EnforceIndex: type: boolean @@ -100897,7 +101188,7 @@ components: Job: $ref: '#/components/schemas/Job' JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -100922,15 +101213,16 @@ components: KnownLeader: true Warnings: Warnings JobModifyIndex: 2147483647 + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer KnownLeader: @@ -100939,7 +101231,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -100960,17 +101252,18 @@ components: JobID: JobID Namespace: Namespace EnforcePriorVersion: 2147483647 + nullable: true properties: ConsulToken: type: string EnforcePriorVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -101015,15 +101308,16 @@ components: JobID: JobID Namespace: Namespace JobModifyIndex: 2147483647 + nullable: true properties: JobCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string JobModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobStopped: @@ -101043,11 +101337,12 @@ components: JobVersion: 2147483647 JobID: JobID Namespace: Namespace + nullable: true properties: JobID: type: string JobVersion: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -101062,9 +101357,10 @@ components: JobStabilityResponse: example: Index: 2147483647 + nullable: true properties: Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -101087,17 +101383,18 @@ components: JobID: JobID ModifyIndex: 2147483647 Namespace: Namespace + nullable: true properties: Children: $ref: '#/components/schemas/JobChildrenSummary' CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer JobID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -106316,6 +106613,7 @@ components: ModifyIndex: 2147483647 NomadTokenID: NomadTokenID Namespace: Namespace + nullable: true properties: Job: $ref: '#/components/schemas/Job' @@ -106334,6 +106632,7 @@ components: Error: Error DriverConfigValidated: true Warnings: Warnings + nullable: true properties: DriverConfigValidated: type: boolean @@ -117611,6 +117910,7 @@ components: LastIndex: 2147483647 RequestTime: 1 KnownLeader: true + nullable: true properties: Diffs: items: @@ -117622,7 +117922,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -117640,6 +117940,7 @@ components: JobHCL: JobHCL hclv1: true Canonicalize: true + nullable: true properties: Canonicalize: type: boolean @@ -117721,6 +118022,7 @@ components: Labels: key: Labels Name: Name + nullable: true properties: Counters: items: @@ -117779,6 +118081,7 @@ components: - Datacenters Count: 9 Name: Name + nullable: true properties: Regions: items: @@ -117796,6 +118099,7 @@ components: - Datacenters Count: 9 Name: Name + nullable: true properties: Count: type: integer @@ -117836,11 +118140,12 @@ components: - EnabledTaskDrivers ModifyIndex: 2147483647 Name: Name + nullable: true properties: Capabilities: $ref: '#/components/schemas/NamespaceCapabilities' CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: @@ -117850,7 +118155,7 @@ components: type: string type: object ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -117866,6 +118171,7 @@ components: EnabledTaskDrivers: - EnabledTaskDrivers - EnabledTaskDrivers + nullable: true properties: DisabledTaskDrivers: items: @@ -117912,6 +118218,7 @@ components: To: 1 HostNetwork: HostNetwork MBits: 5 + nullable: true properties: CIDR: type: string @@ -118425,6 +118732,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: Attributes: additionalProperties: @@ -118441,7 +118749,7 @@ components: CgroupParent: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenter: @@ -118481,7 +118789,7 @@ components: type: string type: object ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -118515,6 +118823,7 @@ components: - 46276 - 46276 TotalCpuCores: 60957 + nullable: true properties: CpuShares: format: int64 @@ -118537,6 +118846,7 @@ components: PciBusID: PciBusID ID: ID Healthy: true + nullable: true properties: HealthDescription: type: string @@ -118550,6 +118860,7 @@ components: NodeDeviceLocality: example: PciBusID: PciBusID + nullable: true properties: PciBusID: type: string @@ -118577,6 +118888,7 @@ components: Int: 2 Vendor: Vendor Name: Name + nullable: true properties: Attributes: additionalProperties: @@ -118596,6 +118908,7 @@ components: NodeDiskResources: example: DiskMB: 4 + nullable: true properties: DiskMB: format: int64 @@ -118610,9 +118923,10 @@ components: EvalIDs: - EvalIDs - EvalIDs + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalIDs: @@ -118620,11 +118934,11 @@ components: type: string type: array LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -118640,9 +118954,10 @@ components: EvalIDs: - EvalIDs - EvalIDs + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalIDs: @@ -118650,11 +118965,11 @@ components: type: string type: array LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -118669,9 +118984,10 @@ components: Message: Message Subsystem: Subsystem Timestamp: 2000-01-23T04:56:07.000+00:00 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Details: @@ -118684,6 +119000,7 @@ components: type: string Timestamp: format: date-time + nullable: true type: string type: object NodeListStub: @@ -118851,6 +119168,7 @@ components: Datacenter: Datacenter ID: ID ModifyIndex: 2147483647 + nullable: true properties: Address: type: string @@ -118859,7 +119177,7 @@ components: type: string type: object CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenter: @@ -118875,7 +119193,7 @@ components: LastDrain: $ref: '#/components/schemas/DrainMetadata' ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -118898,6 +119216,7 @@ components: NodeMemoryResources: example: MemoryMB: 1 + nullable: true properties: MemoryMB: format: int64 @@ -118910,9 +119229,10 @@ components: EvalIDs: - EvalIDs - EvalIDs + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalIDs: @@ -118920,40 +119240,44 @@ components: type: string type: array NodeModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedCpuResources: example: CpuShares: 2147483647 + nullable: true properties: CpuShares: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedDiskResources: example: DiskMB: 2147483647 + nullable: true properties: DiskMB: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedMemoryResources: example: MemoryMB: 2147483647 + nullable: true properties: MemoryMB: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object NodeReservedNetworkResources: example: ReservedHostPorts: ReservedHostPorts + nullable: true properties: ReservedHostPorts: type: string @@ -118968,6 +119292,7 @@ components: CpuShares: 2147483647 Disk: DiskMB: 2147483647 + nullable: true properties: Cpu: $ref: '#/components/schemas/NodeReservedCpuResources' @@ -119104,6 +119429,7 @@ components: Name: Name Disk: DiskMB: 4 + nullable: true properties: Cpu: $ref: '#/components/schemas/NodeCpuResources' @@ -119130,6 +119456,7 @@ components: NodeID: NodeID Scores: key: 3.1497903714250555 + nullable: true properties: NodeID: type: string @@ -119151,6 +119478,7 @@ components: key: Meta MarkEligible: true NodeID: NodeID + nullable: true properties: DrainSpec: $ref: '#/components/schemas/DrainSpec' @@ -119167,6 +119495,7 @@ components: example: Eligibility: Eligibility NodeID: NodeID + nullable: true properties: Eligibility: type: string @@ -119195,6 +119524,7 @@ components: - null - null Name: Name + nullable: true properties: Fields: items: @@ -119216,18 +119546,20 @@ components: ExpiresAt: 2000-01-23T04:56:07.000+00:00 AccessorID: AccessorID ModifyIndex: 2147483647 + nullable: true properties: AccessorID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer ExpiresAt: format: date-time + nullable: true type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer OneTimeSecretID: @@ -119236,6 +119568,7 @@ components: OneTimeTokenExchangeRequest: example: OneTimeSecretID: OneTimeSecretID + nullable: true properties: OneTimeSecretID: type: string @@ -119269,6 +119602,7 @@ components: LastTerm: 2147483647 Name: Name Healthy: true + nullable: true properties: FailureTolerance: type: integer @@ -119288,6 +119622,7 @@ components: MetaRequired: - MetaRequired - MetaRequired + nullable: true properties: MetaOptional: items: @@ -119324,15 +119659,16 @@ components: EvalCreateIndex: 2147483647 Index: 2147483647 EvalID: EvalID + nullable: true properties: EvalCreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer EvalID: type: string Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -119889,6 +120225,7 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: DesiredTGUpdates: additionalProperties: @@ -119905,6 +120242,7 @@ components: - 3.6160767 - 3.6160767 Name: Name + nullable: true properties: Name: type: string @@ -119920,6 +120258,7 @@ components: Value: 5 To: 1 HostNetwork: HostNetwork + nullable: true properties: HostNetwork: type: string @@ -119936,6 +120275,7 @@ components: Label: Label Value: 7 To: 2 + nullable: true properties: HostIP: type: string @@ -119952,6 +120292,7 @@ components: BatchSchedulerEnabled: true ServiceSchedulerEnabled: true SysBatchSchedulerEnabled: true + nullable: true properties: BatchSchedulerEnabled: type: boolean @@ -120079,6 +120420,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: Hash: format: byte @@ -120325,9 +120667,10 @@ components: MemoryMaxMB: 5 ModifyIndex: 2147483647 Name: Name + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Description: @@ -120337,7 +120680,7 @@ components: $ref: '#/components/schemas/QuotaLimit' type: array ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -120360,9 +120703,10 @@ components: Voter: true ID: ID RaftProtocol: RaftProtocol + nullable: true properties: Index: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Servers: @@ -120378,6 +120722,7 @@ components: Voter: true ID: ID RaftProtocol: RaftProtocol + nullable: true properties: Address: type: string @@ -120412,6 +120757,7 @@ components: Weight: -101 Count: 2147483647 Name: Name + nullable: true properties: Affinities: items: @@ -120422,7 +120768,7 @@ components: $ref: '#/components/schemas/Constraint' type: array Count: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Name: @@ -120433,6 +120779,7 @@ components: PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: PrevAllocID: type: string @@ -120476,6 +120823,7 @@ components: - PrevAllocID: PrevAllocID RescheduleTime: 4 PrevNodeID: PrevNodeID + nullable: true properties: Events: items: @@ -120596,6 +120944,7 @@ components: Count: 2147483647 Name: Name MemoryMaxMB: 5 + nullable: true properties: CPU: type: integer @@ -120648,6 +120997,7 @@ components: Sum: 7.061401241503109 Count: 0 Name: Name + nullable: true properties: Count: type: integer @@ -120687,12 +121037,13 @@ components: Time: 2147483647 Count: 5 EvalID: EvalID + nullable: true properties: Count: format: int64 type: integer CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Error: @@ -120708,7 +121059,7 @@ components: format: int64 type: integer Time: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -120726,9 +121077,10 @@ components: ID: ID ModifyIndex: 2147483647 Namespace: Namespace + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Enabled: @@ -120742,7 +121094,7 @@ components: format: int64 type: integer ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -120766,9 +121118,10 @@ components: Enabled: true ID: ID ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Enabled: @@ -120776,7 +121129,7 @@ components: ID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Target: @@ -120799,6 +121152,7 @@ components: Region: Region Count: 0 Namespace: Namespace + nullable: true properties: Count: format: int64 @@ -120838,15 +121192,16 @@ components: RejectJobRegistration: true SchedulerAlgorithm: SchedulerAlgorithm ModifyIndex: 2147483647 + nullable: true properties: CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer MemoryOversubscriptionEnabled: type: boolean ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer PauseEvalBroker: @@ -120877,6 +121232,7 @@ components: RejectJobRegistration: true SchedulerAlgorithm: SchedulerAlgorithm ModifyIndex: 2147483647 + nullable: true properties: KnownLeader: type: boolean @@ -120884,7 +121240,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer NextToken: @@ -120900,9 +121256,10 @@ components: Updated: true LastIndex: 2147483647 RequestTime: 6 + nullable: true properties: LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer RequestTime: @@ -120929,6 +121286,7 @@ components: Region: Region WaitTime: 1 AllowStale: true + nullable: true properties: AllowStale: type: boolean @@ -120960,7 +121318,7 @@ components: Reverse: type: boolean WaitIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer WaitTime: @@ -120980,6 +121338,7 @@ components: LastIndex: 2147483647 RequestTime: 1 KnownLeader: true + nullable: true properties: KnownLeader: type: boolean @@ -120987,7 +121346,7 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Matches: @@ -121020,6 +121379,7 @@ components: Healthy: true LastTerm: 2147483647 Name: Name + nullable: true properties: Address: type: string @@ -121031,11 +121391,11 @@ components: format: int64 type: integer LastIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer LastTerm: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Leader: @@ -121046,6 +121406,7 @@ components: type: string StableSince: format: date-time + nullable: true type: string Version: type: string @@ -121367,6 +121728,7 @@ components: Grace: 0 IgnoreWarnings: true Limit: 4 + nullable: true properties: Address: type: string @@ -121447,6 +121809,7 @@ components: IgnoreWarnings: true Limit: 4 Interval: 7 + nullable: true properties: AddressMode: type: string @@ -121521,13 +121884,14 @@ components: Tags: - Tags - Tags + nullable: true properties: Address: type: string AllocID: type: string CreateIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Datacenter: @@ -121537,7 +121901,7 @@ components: JobID: type: string ModifyIndex: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer Namespace: @@ -121683,6 +122047,7 @@ components: MaxFiles: 4 MaxFileSizeMB: 1 Name: Name + nullable: true properties: Config: additionalProperties: {} @@ -121723,6 +122088,7 @@ components: - Percent: 177 Value: Value Weight: -95 + nullable: true properties: Attribute: type: string @@ -121739,6 +122105,7 @@ components: example: Percent: 177 Value: Value + nullable: true properties: Percent: maximum: 255 @@ -122623,6 +122990,7 @@ components: LogConfig: MaxFiles: 4 MaxFileSizeMB: 1 + nullable: true properties: Affinities: items: @@ -122705,6 +123073,7 @@ components: GetterOptions: key: GetterOptions GetterSource: GetterSource + nullable: true properties: GetterHeaders: additionalProperties: @@ -122727,6 +123096,7 @@ components: Type: Type ID: ID MountDir: MountDir + nullable: true properties: HealthTimeout: format: int64 @@ -122801,6 +123171,7 @@ components: - null Name: Name Name: Name + nullable: true properties: Annotations: items: @@ -122847,6 +123218,7 @@ components: key: Details DisplayMessage: DisplayMessage KillError: KillError + nullable: true properties: Details: additionalProperties: @@ -125451,6 +125823,7 @@ components: SizeMB: 6 Migrate: true Sticky: true + nullable: true properties: Affinities: items: @@ -125697,6 +126070,7 @@ components: - null Name: Name Name: Name + nullable: true properties: Fields: items: @@ -125716,7 +126090,7 @@ components: type: string Updates: additionalProperties: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer type: object @@ -125747,6 +126121,7 @@ components: Desired: 1 Healthy: 9 Placed: 3 + nullable: true properties: Desired: type: integer @@ -125772,6 +126147,7 @@ components: Starting: 4 Running: 2 Queued: 3 + nullable: true properties: Complete: type: integer @@ -125792,6 +126168,7 @@ components: example: Version: 6 DriverState: DriverState + nullable: true properties: DriverState: format: byte @@ -125803,6 +126180,7 @@ components: example: Hook: Hook Sidecar: true + nullable: true properties: Hook: type: string @@ -125873,6 +126251,7 @@ components: TaskHandle: Version: 6 DriverState: DriverState + nullable: true properties: Events: items: @@ -125882,16 +126261,19 @@ components: type: boolean FinishedAt: format: date-time + nullable: true type: string LastRestart: format: date-time + nullable: true type: string Restarts: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer StartedAt: format: date-time + nullable: true type: string State: type: string @@ -125944,6 +126326,7 @@ components: type: object Time: format: date-time + nullable: true type: string UpdateStrategy: example: @@ -125989,6 +126372,7 @@ components: Env: true Namespace: Namespace ChangeMode: ChangeMode + nullable: true properties: ChangeMode: type: string @@ -126033,6 +126417,7 @@ components: FSType: FSType Source: Source Name: Name + nullable: true properties: AccessMode: type: string @@ -126093,7 +126478,7 @@ components: minimum: 0 type: integer uint64: - maximum: 1.8446744073709552E+19 + maximum: 18446744073709552000 minimum: 0 type: integer securitySchemes: diff --git a/clients/java/v1/build.gradle b/clients/java/v1/build.gradle index ef0a26fb..c3dce0a5 100644 --- a/clients/java/v1/build.gradle +++ b/clients/java/v1/build.gradle @@ -1,23 +1,24 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' group = 'io.nomadproject' version = '1.1.4' buildscript { repositories { - maven { url "https://repo1.maven.org/maven2" } - jcenter() + mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' } } repositories { - jcenter() + mavenCentral() } sourceSets { main.java.srcDirs = ['src/main/java'] @@ -52,7 +53,7 @@ if(hasProperty('target') && target == 'android') { } dependencies { - provided 'javax.annotation:javax.annotation-api:1.3.2' + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" } } @@ -80,14 +81,17 @@ if(hasProperty('target') && target == 'android') { } else { apply plugin: 'java' - apply plugin: 'maven' + apply plugin: 'maven-publish' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - install { - repositories.mavenInstaller { - pom.artifactId = 'nomad-openapi-java-client' + publishing { + publications { + maven(MavenPublication) { + artifactId = 'nomad-openapi-java-client' + from components.java + } } } @@ -97,19 +101,53 @@ if(hasProperty('target') && target == 'android') { } } +ext { + jakarta_annotation_version = "1.3.5" +} + dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' + implementation 'io.swagger:swagger-annotations:1.6.5' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' - implementation 'javax.annotation:javax.annotation-api:1.3.2' - testImplementation 'junit:junit:4.13.1' + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.2' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.mockito:mockito-core:3.12.4' } javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/clients/java/v1/build.sbt b/clients/java/v1/build.sbt index 56c79186..31f053a2 100644 --- a/clients/java/v1/build.sbt +++ b/clients/java/v1/build.sbt @@ -9,17 +9,19 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", - "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.9.3", + "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", + "com.google.code.gson" % "gson" % "2.9.0", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/clients/java/v1/docs/ACLPolicy.md b/clients/java/v1/docs/ACLPolicy.md index db17ed7c..67857937 100644 --- a/clients/java/v1/docs/ACLPolicy.md +++ b/clients/java/v1/docs/ACLPolicy.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**description** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**rules** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**description** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**rules** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ACLPolicyListStub.md b/clients/java/v1/docs/ACLPolicyListStub.md index 4b4a7054..8ace494e 100644 --- a/clients/java/v1/docs/ACLPolicyListStub.md +++ b/clients/java/v1/docs/ACLPolicyListStub.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**description** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**description** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ACLToken.md b/clients/java/v1/docs/ACLToken.md index 2322abb7..02d18cd0 100644 --- a/clients/java/v1/docs/ACLToken.md +++ b/clients/java/v1/docs/ACLToken.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessorID** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**createTime** | **OffsetDateTime** | | [optional] -**global** | **Boolean** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**policies** | **List<String>** | | [optional] -**secretID** | **String** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessorID** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**createTime** | **OffsetDateTime** | | [optional] | +|**global** | **Boolean** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**policies** | **List<String>** | | [optional] | +|**secretID** | **String** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ACLTokenListStub.md b/clients/java/v1/docs/ACLTokenListStub.md index 8c7f2dd5..27fc14c3 100644 --- a/clients/java/v1/docs/ACLTokenListStub.md +++ b/clients/java/v1/docs/ACLTokenListStub.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessorID** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**createTime** | **OffsetDateTime** | | [optional] -**global** | **Boolean** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**policies** | **List<String>** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessorID** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**createTime** | **OffsetDateTime** | | [optional] | +|**global** | **Boolean** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**policies** | **List<String>** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/AclApi.md b/clients/java/v1/docs/AclApi.md index fc09ffe9..dad9a194 100644 --- a/clients/java/v1/docs/AclApi.md +++ b/clients/java/v1/docs/AclApi.md @@ -2,20 +2,20 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteACLPolicy**](AclApi.md#deleteACLPolicy) | **DELETE** /acl/policy/{policyName} | -[**deleteACLToken**](AclApi.md#deleteACLToken) | **DELETE** /acl/token/{tokenAccessor} | -[**getACLPolicies**](AclApi.md#getACLPolicies) | **GET** /acl/policies | -[**getACLPolicy**](AclApi.md#getACLPolicy) | **GET** /acl/policy/{policyName} | -[**getACLToken**](AclApi.md#getACLToken) | **GET** /acl/token/{tokenAccessor} | -[**getACLTokenSelf**](AclApi.md#getACLTokenSelf) | **GET** /acl/token | -[**getACLTokens**](AclApi.md#getACLTokens) | **GET** /acl/tokens | -[**postACLBootstrap**](AclApi.md#postACLBootstrap) | **POST** /acl/bootstrap | -[**postACLPolicy**](AclApi.md#postACLPolicy) | **POST** /acl/policy/{policyName} | -[**postACLToken**](AclApi.md#postACLToken) | **POST** /acl/token/{tokenAccessor} | -[**postACLTokenOnetime**](AclApi.md#postACLTokenOnetime) | **POST** /acl/token/onetime | -[**postACLTokenOnetimeExchange**](AclApi.md#postACLTokenOnetimeExchange) | **POST** /acl/token/onetime/exchange | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteACLPolicy**](AclApi.md#deleteACLPolicy) | **DELETE** /acl/policy/{policyName} | | +| [**deleteACLToken**](AclApi.md#deleteACLToken) | **DELETE** /acl/token/{tokenAccessor} | | +| [**getACLPolicies**](AclApi.md#getACLPolicies) | **GET** /acl/policies | | +| [**getACLPolicy**](AclApi.md#getACLPolicy) | **GET** /acl/policy/{policyName} | | +| [**getACLToken**](AclApi.md#getACLToken) | **GET** /acl/token/{tokenAccessor} | | +| [**getACLTokenSelf**](AclApi.md#getACLTokenSelf) | **GET** /acl/token | | +| [**getACLTokens**](AclApi.md#getACLTokens) | **GET** /acl/tokens | | +| [**postACLBootstrap**](AclApi.md#postACLBootstrap) | **POST** /acl/bootstrap | | +| [**postACLPolicy**](AclApi.md#postACLPolicy) | **POST** /acl/policy/{policyName} | | +| [**postACLToken**](AclApi.md#postACLToken) | **POST** /acl/token/{tokenAccessor} | | +| [**postACLTokenOnetime**](AclApi.md#postACLTokenOnetime) | **POST** /acl/token/onetime | | +| [**postACLTokenOnetimeExchange**](AclApi.md#postACLTokenOnetimeExchange) | **POST** /acl/token/onetime/exchange | | @@ -66,13 +66,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyName** | **String**| The ACL policy name. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyName** | **String**| The ACL policy name. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -90,11 +90,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **deleteACLToken** @@ -144,13 +144,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tokenAccessor** | **String**| The token accessor ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tokenAccessor** | **String**| The token accessor ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -168,11 +168,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getACLPolicies** @@ -227,17 +227,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -255,11 +255,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getACLPolicy** @@ -315,18 +315,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyName** | **String**| The ACL policy name. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyName** | **String**| The ACL policy name. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -344,11 +344,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getACLToken** @@ -404,18 +404,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tokenAccessor** | **String**| The token accessor ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tokenAccessor** | **String**| The token accessor ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -433,11 +433,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getACLTokenSelf** @@ -492,17 +492,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -520,11 +520,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getACLTokens** @@ -579,17 +579,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -607,11 +607,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postACLBootstrap** @@ -661,12 +661,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -684,11 +684,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postACLPolicy** @@ -739,14 +739,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyName** | **String**| The ACL policy name. | - **acLPolicy** | [**ACLPolicy**](ACLPolicy.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyName** | **String**| The ACL policy name. | | +| **acLPolicy** | [**ACLPolicy**](ACLPolicy.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -764,11 +764,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postACLToken** @@ -820,14 +820,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tokenAccessor** | **String**| The token accessor ID. | - **acLToken** | [**ACLToken**](ACLToken.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tokenAccessor** | **String**| The token accessor ID. | | +| **acLToken** | [**ACLToken**](ACLToken.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -845,11 +845,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postACLTokenOnetime** @@ -899,12 +899,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -922,11 +922,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postACLTokenOnetimeExchange** @@ -977,13 +977,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **oneTimeTokenExchangeRequest** | [**OneTimeTokenExchangeRequest**](OneTimeTokenExchangeRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **oneTimeTokenExchangeRequest** | [**OneTimeTokenExchangeRequest**](OneTimeTokenExchangeRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1001,9 +1001,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/Affinity.md b/clients/java/v1/docs/Affinity.md index 65e99d18..9220023c 100644 --- a/clients/java/v1/docs/Affinity.md +++ b/clients/java/v1/docs/Affinity.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ltarget** | **String** | | [optional] -**operand** | **String** | | [optional] -**rtarget** | **String** | | [optional] -**weight** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ltarget** | **String** | | [optional] | +|**operand** | **String** | | [optional] | +|**rtarget** | **String** | | [optional] | +|**weight** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/AllocDeploymentStatus.md b/clients/java/v1/docs/AllocDeploymentStatus.md index 4978362f..c508b6a1 100644 --- a/clients/java/v1/docs/AllocDeploymentStatus.md +++ b/clients/java/v1/docs/AllocDeploymentStatus.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**canary** | **Boolean** | | [optional] -**healthy** | **Boolean** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**timestamp** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**canary** | **Boolean** | | [optional] | +|**healthy** | **Boolean** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**timestamp** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/AllocStopResponse.md b/clients/java/v1/docs/AllocStopResponse.md index 760450d7..6f0e90dc 100644 --- a/clients/java/v1/docs/AllocStopResponse.md +++ b/clients/java/v1/docs/AllocStopResponse.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalID** | **String** | | [optional] -**index** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalID** | **String** | | [optional] | +|**index** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/AllocatedCpuResources.md b/clients/java/v1/docs/AllocatedCpuResources.md index 59bf1677..0ecd533d 100644 --- a/clients/java/v1/docs/AllocatedCpuResources.md +++ b/clients/java/v1/docs/AllocatedCpuResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cpuShares** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cpuShares** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/AllocatedDeviceResource.md b/clients/java/v1/docs/AllocatedDeviceResource.md index 9d4bbc1e..8f4b516f 100644 --- a/clients/java/v1/docs/AllocatedDeviceResource.md +++ b/clients/java/v1/docs/AllocatedDeviceResource.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deviceIDs** | **List<String>** | | [optional] -**name** | **String** | | [optional] -**type** | **String** | | [optional] -**vendor** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deviceIDs** | **List<String>** | | [optional] | +|**name** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**vendor** | **String** | | [optional] | diff --git a/clients/java/v1/docs/AllocatedMemoryResources.md b/clients/java/v1/docs/AllocatedMemoryResources.md index 0800b6e5..5be5768d 100644 --- a/clients/java/v1/docs/AllocatedMemoryResources.md +++ b/clients/java/v1/docs/AllocatedMemoryResources.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**memoryMB** | **Long** | | [optional] -**memoryMaxMB** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**memoryMB** | **Long** | | [optional] | +|**memoryMaxMB** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/AllocatedResources.md b/clients/java/v1/docs/AllocatedResources.md index 5b6f8bb8..430a990a 100644 --- a/clients/java/v1/docs/AllocatedResources.md +++ b/clients/java/v1/docs/AllocatedResources.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shared** | [**AllocatedSharedResources**](AllocatedSharedResources.md) | | [optional] -**tasks** | [**Map<String, AllocatedTaskResources>**](AllocatedTaskResources.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shared** | [**AllocatedSharedResources**](AllocatedSharedResources.md) | | [optional] | +|**tasks** | [**Map<String, AllocatedTaskResources>**](AllocatedTaskResources.md) | | [optional] | diff --git a/clients/java/v1/docs/AllocatedSharedResources.md b/clients/java/v1/docs/AllocatedSharedResources.md index 2f88f7b1..fe9ba3e8 100644 --- a/clients/java/v1/docs/AllocatedSharedResources.md +++ b/clients/java/v1/docs/AllocatedSharedResources.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diskMB** | **Long** | | [optional] -**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] -**ports** | [**List<PortMapping>**](PortMapping.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diskMB** | **Long** | | [optional] | +|**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] | +|**ports** | [**List<PortMapping>**](PortMapping.md) | | [optional] | diff --git a/clients/java/v1/docs/AllocatedTaskResources.md b/clients/java/v1/docs/AllocatedTaskResources.md index 1c8cf39d..9aba9cb2 100644 --- a/clients/java/v1/docs/AllocatedTaskResources.md +++ b/clients/java/v1/docs/AllocatedTaskResources.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cpu** | [**AllocatedCpuResources**](AllocatedCpuResources.md) | | [optional] -**devices** | [**List<AllocatedDeviceResource>**](AllocatedDeviceResource.md) | | [optional] -**memory** | [**AllocatedMemoryResources**](AllocatedMemoryResources.md) | | [optional] -**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cpu** | [**AllocatedCpuResources**](AllocatedCpuResources.md) | | [optional] | +|**devices** | [**List<AllocatedDeviceResource>**](AllocatedDeviceResource.md) | | [optional] | +|**memory** | [**AllocatedMemoryResources**](AllocatedMemoryResources.md) | | [optional] | +|**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] | diff --git a/clients/java/v1/docs/Allocation.md b/clients/java/v1/docs/Allocation.md index 578700f6..f2342b40 100644 --- a/clients/java/v1/docs/Allocation.md +++ b/clients/java/v1/docs/Allocation.md @@ -5,41 +5,41 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allocModifyIndex** | **Integer** | | [optional] -**allocatedResources** | [**AllocatedResources**](AllocatedResources.md) | | [optional] -**clientDescription** | **String** | | [optional] -**clientStatus** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**createTime** | **Long** | | [optional] -**deploymentID** | **String** | | [optional] -**deploymentStatus** | [**AllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] -**desiredDescription** | **String** | | [optional] -**desiredStatus** | **String** | | [optional] -**desiredTransition** | [**DesiredTransition**](DesiredTransition.md) | | [optional] -**evalID** | **String** | | [optional] -**followupEvalID** | **String** | | [optional] -**ID** | **String** | | [optional] -**job** | [**Job**](Job.md) | | [optional] -**jobID** | **String** | | [optional] -**metrics** | [**AllocationMetric**](AllocationMetric.md) | | [optional] -**modifyIndex** | **Integer** | | [optional] -**modifyTime** | **Long** | | [optional] -**name** | **String** | | [optional] -**namespace** | **String** | | [optional] -**nextAllocation** | **String** | | [optional] -**nodeID** | **String** | | [optional] -**nodeName** | **String** | | [optional] -**preemptedAllocations** | **List<String>** | | [optional] -**preemptedByAllocation** | **String** | | [optional] -**previousAllocation** | **String** | | [optional] -**rescheduleTracker** | [**RescheduleTracker**](RescheduleTracker.md) | | [optional] -**resources** | [**Resources**](Resources.md) | | [optional] -**services** | **Map<String, String>** | | [optional] -**taskGroup** | **String** | | [optional] -**taskResources** | [**Map<String, Resources>**](Resources.md) | | [optional] -**taskStates** | [**Map<String, TaskState>**](TaskState.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allocModifyIndex** | **Integer** | | [optional] | +|**allocatedResources** | [**AllocatedResources**](AllocatedResources.md) | | [optional] | +|**clientDescription** | **String** | | [optional] | +|**clientStatus** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**deploymentID** | **String** | | [optional] | +|**deploymentStatus** | [**AllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] | +|**desiredDescription** | **String** | | [optional] | +|**desiredStatus** | **String** | | [optional] | +|**desiredTransition** | [**DesiredTransition**](DesiredTransition.md) | | [optional] | +|**evalID** | **String** | | [optional] | +|**followupEvalID** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**job** | [**Job**](Job.md) | | [optional] | +|**jobID** | **String** | | [optional] | +|**metrics** | [**AllocationMetric**](AllocationMetric.md) | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**modifyTime** | **Long** | | [optional] | +|**name** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nextAllocation** | **String** | | [optional] | +|**nodeID** | **String** | | [optional] | +|**nodeName** | **String** | | [optional] | +|**preemptedAllocations** | **List<String>** | | [optional] | +|**preemptedByAllocation** | **String** | | [optional] | +|**previousAllocation** | **String** | | [optional] | +|**rescheduleTracker** | [**RescheduleTracker**](RescheduleTracker.md) | | [optional] | +|**resources** | [**Resources**](Resources.md) | | [optional] | +|**services** | **Map<String, String>** | | [optional] | +|**taskGroup** | **String** | | [optional] | +|**taskResources** | [**Map<String, Resources>**](Resources.md) | | [optional] | +|**taskStates** | [**Map<String, TaskState>**](TaskState.md) | | [optional] | diff --git a/clients/java/v1/docs/AllocationListStub.md b/clients/java/v1/docs/AllocationListStub.md index 9db5cc80..eefb6002 100644 --- a/clients/java/v1/docs/AllocationListStub.md +++ b/clients/java/v1/docs/AllocationListStub.md @@ -5,33 +5,33 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allocatedResources** | [**AllocatedResources**](AllocatedResources.md) | | [optional] -**clientDescription** | **String** | | [optional] -**clientStatus** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**createTime** | **Long** | | [optional] -**deploymentStatus** | [**AllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] -**desiredDescription** | **String** | | [optional] -**desiredStatus** | **String** | | [optional] -**evalID** | **String** | | [optional] -**followupEvalID** | **String** | | [optional] -**ID** | **String** | | [optional] -**jobID** | **String** | | [optional] -**jobType** | **String** | | [optional] -**jobVersion** | **Integer** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**modifyTime** | **Long** | | [optional] -**name** | **String** | | [optional] -**namespace** | **String** | | [optional] -**nodeID** | **String** | | [optional] -**nodeName** | **String** | | [optional] -**preemptedAllocations** | **List<String>** | | [optional] -**preemptedByAllocation** | **String** | | [optional] -**rescheduleTracker** | [**RescheduleTracker**](RescheduleTracker.md) | | [optional] -**taskGroup** | **String** | | [optional] -**taskStates** | [**Map<String, TaskState>**](TaskState.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allocatedResources** | [**AllocatedResources**](AllocatedResources.md) | | [optional] | +|**clientDescription** | **String** | | [optional] | +|**clientStatus** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**deploymentStatus** | [**AllocDeploymentStatus**](AllocDeploymentStatus.md) | | [optional] | +|**desiredDescription** | **String** | | [optional] | +|**desiredStatus** | **String** | | [optional] | +|**evalID** | **String** | | [optional] | +|**followupEvalID** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**jobID** | **String** | | [optional] | +|**jobType** | **String** | | [optional] | +|**jobVersion** | **Integer** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**modifyTime** | **Long** | | [optional] | +|**name** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nodeID** | **String** | | [optional] | +|**nodeName** | **String** | | [optional] | +|**preemptedAllocations** | **List<String>** | | [optional] | +|**preemptedByAllocation** | **String** | | [optional] | +|**rescheduleTracker** | [**RescheduleTracker**](RescheduleTracker.md) | | [optional] | +|**taskGroup** | **String** | | [optional] | +|**taskStates** | [**Map<String, TaskState>**](TaskState.md) | | [optional] | diff --git a/clients/java/v1/docs/AllocationMetric.md b/clients/java/v1/docs/AllocationMetric.md index fe69a379..4c29d62e 100644 --- a/clients/java/v1/docs/AllocationMetric.md +++ b/clients/java/v1/docs/AllocationMetric.md @@ -5,22 +5,22 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allocationTime** | **Long** | | [optional] -**classExhausted** | **Map<String, Integer>** | | [optional] -**classFiltered** | **Map<String, Integer>** | | [optional] -**coalescedFailures** | **Integer** | | [optional] -**constraintFiltered** | **Map<String, Integer>** | | [optional] -**dimensionExhausted** | **Map<String, Integer>** | | [optional] -**nodesAvailable** | **Map<String, Integer>** | | [optional] -**nodesEvaluated** | **Integer** | | [optional] -**nodesExhausted** | **Integer** | | [optional] -**nodesFiltered** | **Integer** | | [optional] -**quotaExhausted** | **List<String>** | | [optional] -**resourcesExhausted** | [**Map<String, Resources>**](Resources.md) | | [optional] -**scoreMetaData** | [**List<NodeScoreMeta>**](NodeScoreMeta.md) | | [optional] -**scores** | **Map<String, Double>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allocationTime** | **Long** | | [optional] | +|**classExhausted** | **Map<String, Integer>** | | [optional] | +|**classFiltered** | **Map<String, Integer>** | | [optional] | +|**coalescedFailures** | **Integer** | | [optional] | +|**constraintFiltered** | **Map<String, Integer>** | | [optional] | +|**dimensionExhausted** | **Map<String, Integer>** | | [optional] | +|**nodesAvailable** | **Map<String, Integer>** | | [optional] | +|**nodesEvaluated** | **Integer** | | [optional] | +|**nodesExhausted** | **Integer** | | [optional] | +|**nodesFiltered** | **Integer** | | [optional] | +|**quotaExhausted** | **List<String>** | | [optional] | +|**resourcesExhausted** | [**Map<String, Resources>**](Resources.md) | | [optional] | +|**scoreMetaData** | [**List<NodeScoreMeta>**](NodeScoreMeta.md) | | [optional] | +|**scores** | **Map<String, Double>** | | [optional] | diff --git a/clients/java/v1/docs/AllocationsApi.md b/clients/java/v1/docs/AllocationsApi.md index ad4358a5..0b3262fb 100644 --- a/clients/java/v1/docs/AllocationsApi.md +++ b/clients/java/v1/docs/AllocationsApi.md @@ -2,12 +2,12 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getAllocation**](AllocationsApi.md#getAllocation) | **GET** /allocation/{allocID} | -[**getAllocationServices**](AllocationsApi.md#getAllocationServices) | **GET** /allocation/{allocID}/services | -[**getAllocations**](AllocationsApi.md#getAllocations) | **GET** /allocations | -[**postAllocationStop**](AllocationsApi.md#postAllocationStop) | **POST** /allocation/{allocID}/stop | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getAllocation**](AllocationsApi.md#getAllocation) | **GET** /allocation/{allocID} | | +| [**getAllocationServices**](AllocationsApi.md#getAllocationServices) | **GET** /allocation/{allocID}/services | | +| [**getAllocations**](AllocationsApi.md#getAllocations) | **GET** /allocations | | +| [**postAllocationStop**](AllocationsApi.md#postAllocationStop) | **POST** /allocation/{allocID}/stop | | @@ -64,18 +64,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **allocID** | **String**| Allocation ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **allocID** | **String**| Allocation ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -93,11 +93,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getAllocationServices** @@ -153,18 +153,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **allocID** | **String**| Allocation ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **allocID** | **String**| Allocation ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -182,11 +182,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getAllocations** @@ -243,19 +243,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **resources** | **Boolean**| Flag indicating whether to include resources in response. | [optional] - **taskStates** | **Boolean**| Flag indicating whether to include task states in response. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **resources** | **Boolean**| Flag indicating whether to include resources in response. | [optional] | +| **taskStates** | **Boolean**| Flag indicating whether to include task states in response. | [optional] | ### Return type @@ -273,11 +273,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postAllocationStop** @@ -334,19 +334,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **allocID** | **String**| Allocation ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **noShutdownDelay** | **Boolean**| Flag indicating whether to delay shutdown when requesting an allocation stop. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **allocID** | **String**| Allocation ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **noShutdownDelay** | **Boolean**| Flag indicating whether to delay shutdown when requesting an allocation stop. | [optional] | ### Return type @@ -364,9 +364,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/Attribute.md b/clients/java/v1/docs/Attribute.md index f838f5ba..67604147 100644 --- a/clients/java/v1/docs/Attribute.md +++ b/clients/java/v1/docs/Attribute.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bool** | **Boolean** | | [optional] -**_float** | **Double** | | [optional] -**_int** | **Long** | | [optional] -**string** | **String** | | [optional] -**unit** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bool** | **Boolean** | | [optional] | +|**_float** | **Double** | | [optional] | +|**_int** | **Long** | | [optional] | +|**string** | **String** | | [optional] | +|**unit** | **String** | | [optional] | diff --git a/clients/java/v1/docs/AutopilotConfiguration.md b/clients/java/v1/docs/AutopilotConfiguration.md index 58e2efa6..f93fe39f 100644 --- a/clients/java/v1/docs/AutopilotConfiguration.md +++ b/clients/java/v1/docs/AutopilotConfiguration.md @@ -5,18 +5,18 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cleanupDeadServers** | **Boolean** | | [optional] -**createIndex** | **Integer** | | [optional] -**disableUpgradeMigration** | **Boolean** | | [optional] -**enableCustomUpgrades** | **Boolean** | | [optional] -**enableRedundancyZones** | **Boolean** | | [optional] -**lastContactThreshold** | **String** | | [optional] -**maxTrailingLogs** | **Integer** | | [optional] -**minQuorum** | **Integer** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**serverStabilizationTime** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cleanupDeadServers** | **Boolean** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**disableUpgradeMigration** | **Boolean** | | [optional] | +|**enableCustomUpgrades** | **Boolean** | | [optional] | +|**enableRedundancyZones** | **Boolean** | | [optional] | +|**lastContactThreshold** | **String** | | [optional] | +|**maxTrailingLogs** | **Integer** | | [optional] | +|**minQuorum** | **Integer** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**serverStabilizationTime** | **String** | | [optional] | diff --git a/clients/java/v1/docs/CSIControllerInfo.md b/clients/java/v1/docs/CSIControllerInfo.md index 5b5f1ba8..212dfa74 100644 --- a/clients/java/v1/docs/CSIControllerInfo.md +++ b/clients/java/v1/docs/CSIControllerInfo.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**supportsAttachDetach** | **Boolean** | | [optional] -**supportsClone** | **Boolean** | | [optional] -**supportsCondition** | **Boolean** | | [optional] -**supportsCreateDelete** | **Boolean** | | [optional] -**supportsCreateDeleteSnapshot** | **Boolean** | | [optional] -**supportsExpand** | **Boolean** | | [optional] -**supportsGet** | **Boolean** | | [optional] -**supportsGetCapacity** | **Boolean** | | [optional] -**supportsListSnapshots** | **Boolean** | | [optional] -**supportsListVolumes** | **Boolean** | | [optional] -**supportsListVolumesAttachedNodes** | **Boolean** | | [optional] -**supportsReadOnlyAttach** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**supportsAttachDetach** | **Boolean** | | [optional] | +|**supportsClone** | **Boolean** | | [optional] | +|**supportsCondition** | **Boolean** | | [optional] | +|**supportsCreateDelete** | **Boolean** | | [optional] | +|**supportsCreateDeleteSnapshot** | **Boolean** | | [optional] | +|**supportsExpand** | **Boolean** | | [optional] | +|**supportsGet** | **Boolean** | | [optional] | +|**supportsGetCapacity** | **Boolean** | | [optional] | +|**supportsListSnapshots** | **Boolean** | | [optional] | +|**supportsListVolumes** | **Boolean** | | [optional] | +|**supportsListVolumesAttachedNodes** | **Boolean** | | [optional] | +|**supportsReadOnlyAttach** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/CSIInfo.md b/clients/java/v1/docs/CSIInfo.md index 3d0aa283..34a9c545 100644 --- a/clients/java/v1/docs/CSIInfo.md +++ b/clients/java/v1/docs/CSIInfo.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allocID** | **String** | | [optional] -**controllerInfo** | [**CSIControllerInfo**](CSIControllerInfo.md) | | [optional] -**healthDescription** | **String** | | [optional] -**healthy** | **Boolean** | | [optional] -**nodeInfo** | [**CSINodeInfo**](CSINodeInfo.md) | | [optional] -**pluginID** | **String** | | [optional] -**requiresControllerPlugin** | **Boolean** | | [optional] -**requiresTopologies** | **Boolean** | | [optional] -**updateTime** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allocID** | **String** | | [optional] | +|**controllerInfo** | [**CSIControllerInfo**](CSIControllerInfo.md) | | [optional] | +|**healthDescription** | **String** | | [optional] | +|**healthy** | **Boolean** | | [optional] | +|**nodeInfo** | [**CSINodeInfo**](CSINodeInfo.md) | | [optional] | +|**pluginID** | **String** | | [optional] | +|**requiresControllerPlugin** | **Boolean** | | [optional] | +|**requiresTopologies** | **Boolean** | | [optional] | +|**updateTime** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/CSIMountOptions.md b/clients/java/v1/docs/CSIMountOptions.md index a97e4810..0a356db7 100644 --- a/clients/java/v1/docs/CSIMountOptions.md +++ b/clients/java/v1/docs/CSIMountOptions.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fsType** | **String** | | [optional] -**mountFlags** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fsType** | **String** | | [optional] | +|**mountFlags** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/CSINodeInfo.md b/clients/java/v1/docs/CSINodeInfo.md index 12624566..44f343fc 100644 --- a/clients/java/v1/docs/CSINodeInfo.md +++ b/clients/java/v1/docs/CSINodeInfo.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessibleTopology** | [**CSITopology**](CSITopology.md) | | [optional] -**ID** | **String** | | [optional] -**maxVolumes** | **Long** | | [optional] -**requiresNodeStageVolume** | **Boolean** | | [optional] -**supportsCondition** | **Boolean** | | [optional] -**supportsExpand** | **Boolean** | | [optional] -**supportsStats** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessibleTopology** | [**CSITopology**](CSITopology.md) | | [optional] | +|**ID** | **String** | | [optional] | +|**maxVolumes** | **Long** | | [optional] | +|**requiresNodeStageVolume** | **Boolean** | | [optional] | +|**supportsCondition** | **Boolean** | | [optional] | +|**supportsExpand** | **Boolean** | | [optional] | +|**supportsStats** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/CSIPlugin.md b/clients/java/v1/docs/CSIPlugin.md index 17af18f3..bf0d7c6a 100644 --- a/clients/java/v1/docs/CSIPlugin.md +++ b/clients/java/v1/docs/CSIPlugin.md @@ -5,21 +5,21 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allocations** | [**List<AllocationListStub>**](AllocationListStub.md) | | [optional] -**controllerRequired** | **Boolean** | | [optional] -**controllers** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] -**controllersExpected** | **Integer** | | [optional] -**controllersHealthy** | **Integer** | | [optional] -**createIndex** | **Integer** | | [optional] -**ID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**nodes** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] -**nodesExpected** | **Integer** | | [optional] -**nodesHealthy** | **Integer** | | [optional] -**provider** | **String** | | [optional] -**version** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allocations** | [**List<AllocationListStub>**](AllocationListStub.md) | | [optional] | +|**controllerRequired** | **Boolean** | | [optional] | +|**controllers** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] | +|**controllersExpected** | **Integer** | | [optional] | +|**controllersHealthy** | **Integer** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**ID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**nodes** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] | +|**nodesExpected** | **Integer** | | [optional] | +|**nodesHealthy** | **Integer** | | [optional] | +|**provider** | **String** | | [optional] | +|**version** | **String** | | [optional] | diff --git a/clients/java/v1/docs/CSIPluginListStub.md b/clients/java/v1/docs/CSIPluginListStub.md index 7046565e..4d6f8b46 100644 --- a/clients/java/v1/docs/CSIPluginListStub.md +++ b/clients/java/v1/docs/CSIPluginListStub.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**controllerRequired** | **Boolean** | | [optional] -**controllersExpected** | **Integer** | | [optional] -**controllersHealthy** | **Integer** | | [optional] -**createIndex** | **Integer** | | [optional] -**ID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**nodesExpected** | **Integer** | | [optional] -**nodesHealthy** | **Integer** | | [optional] -**provider** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**controllerRequired** | **Boolean** | | [optional] | +|**controllersExpected** | **Integer** | | [optional] | +|**controllersHealthy** | **Integer** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**ID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**nodesExpected** | **Integer** | | [optional] | +|**nodesHealthy** | **Integer** | | [optional] | +|**provider** | **String** | | [optional] | diff --git a/clients/java/v1/docs/CSISnapshot.md b/clients/java/v1/docs/CSISnapshot.md index 98d1f4e1..e7c5e296 100644 --- a/clients/java/v1/docs/CSISnapshot.md +++ b/clients/java/v1/docs/CSISnapshot.md @@ -5,18 +5,18 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createTime** | **Long** | | [optional] -**externalSourceVolumeID** | **String** | | [optional] -**ID** | **String** | | [optional] -**isReady** | **Boolean** | | [optional] -**name** | **String** | | [optional] -**parameters** | **Map<String, String>** | | [optional] -**pluginID** | **String** | | [optional] -**secrets** | **Map<String, String>** | | [optional] -**sizeBytes** | **Long** | | [optional] -**sourceVolumeID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createTime** | **Long** | | [optional] | +|**externalSourceVolumeID** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**isReady** | **Boolean** | | [optional] | +|**name** | **String** | | [optional] | +|**parameters** | **Map<String, String>** | | [optional] | +|**pluginID** | **String** | | [optional] | +|**secrets** | **Map<String, String>** | | [optional] | +|**sizeBytes** | **Long** | | [optional] | +|**sourceVolumeID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/CSISnapshotCreateRequest.md b/clients/java/v1/docs/CSISnapshotCreateRequest.md index 240e0998..3b2a2649 100644 --- a/clients/java/v1/docs/CSISnapshotCreateRequest.md +++ b/clients/java/v1/docs/CSISnapshotCreateRequest.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**snapshots** | [**List<CSISnapshot>**](CSISnapshot.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**snapshots** | [**List<CSISnapshot>**](CSISnapshot.md) | | [optional] | diff --git a/clients/java/v1/docs/CSISnapshotCreateResponse.md b/clients/java/v1/docs/CSISnapshotCreateResponse.md index 0b6d74af..7aa46809 100644 --- a/clients/java/v1/docs/CSISnapshotCreateResponse.md +++ b/clients/java/v1/docs/CSISnapshotCreateResponse.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**snapshots** | [**List<CSISnapshot>**](CSISnapshot.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**snapshots** | [**List<CSISnapshot>**](CSISnapshot.md) | | [optional] | diff --git a/clients/java/v1/docs/CSISnapshotListResponse.md b/clients/java/v1/docs/CSISnapshotListResponse.md index 8d9d42fd..213428f9 100644 --- a/clients/java/v1/docs/CSISnapshotListResponse.md +++ b/clients/java/v1/docs/CSISnapshotListResponse.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**snapshots** | [**List<CSISnapshot>**](CSISnapshot.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**snapshots** | [**List<CSISnapshot>**](CSISnapshot.md) | | [optional] | diff --git a/clients/java/v1/docs/CSITopology.md b/clients/java/v1/docs/CSITopology.md index 3d1855d7..4612b534 100644 --- a/clients/java/v1/docs/CSITopology.md +++ b/clients/java/v1/docs/CSITopology.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**segments** | **Map<String, String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**segments** | **Map<String, String>** | | [optional] | diff --git a/clients/java/v1/docs/CSITopologyRequest.md b/clients/java/v1/docs/CSITopologyRequest.md index 3991501c..adc8db83 100644 --- a/clients/java/v1/docs/CSITopologyRequest.md +++ b/clients/java/v1/docs/CSITopologyRequest.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**preferred** | [**List<CSITopology>**](CSITopology.md) | | [optional] -**required** | [**List<CSITopology>**](CSITopology.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**preferred** | [**List<CSITopology>**](CSITopology.md) | | [optional] | +|**required** | [**List<CSITopology>**](CSITopology.md) | | [optional] | diff --git a/clients/java/v1/docs/CSIVolume.md b/clients/java/v1/docs/CSIVolume.md index 894c07df..58192c7b 100644 --- a/clients/java/v1/docs/CSIVolume.md +++ b/clients/java/v1/docs/CSIVolume.md @@ -5,41 +5,41 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessMode** | **String** | | [optional] -**allocations** | [**List<AllocationListStub>**](AllocationListStub.md) | | [optional] -**attachmentMode** | **String** | | [optional] -**capacity** | **Long** | | [optional] -**cloneID** | **String** | | [optional] -**context** | **Map<String, String>** | | [optional] -**controllerRequired** | **Boolean** | | [optional] -**controllersExpected** | **Integer** | | [optional] -**controllersHealthy** | **Integer** | | [optional] -**createIndex** | **Integer** | | [optional] -**externalID** | **String** | | [optional] -**ID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**mountOptions** | [**CSIMountOptions**](CSIMountOptions.md) | | [optional] -**name** | **String** | | [optional] -**namespace** | **String** | | [optional] -**nodesExpected** | **Integer** | | [optional] -**nodesHealthy** | **Integer** | | [optional] -**parameters** | **Map<String, String>** | | [optional] -**pluginID** | **String** | | [optional] -**provider** | **String** | | [optional] -**providerVersion** | **String** | | [optional] -**readAllocs** | [**Map<String, Allocation>**](Allocation.md) | | [optional] -**requestedCapabilities** | [**List<CSIVolumeCapability>**](CSIVolumeCapability.md) | | [optional] -**requestedCapacityMax** | **Long** | | [optional] -**requestedCapacityMin** | **Long** | | [optional] -**requestedTopologies** | [**CSITopologyRequest**](CSITopologyRequest.md) | | [optional] -**resourceExhausted** | **OffsetDateTime** | | [optional] -**schedulable** | **Boolean** | | [optional] -**secrets** | **Map<String, String>** | | [optional] -**snapshotID** | **String** | | [optional] -**topologies** | [**List<CSITopology>**](CSITopology.md) | | [optional] -**writeAllocs** | [**Map<String, Allocation>**](Allocation.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessMode** | **String** | | [optional] | +|**allocations** | [**List<AllocationListStub>**](AllocationListStub.md) | | [optional] | +|**attachmentMode** | **String** | | [optional] | +|**capacity** | **Long** | | [optional] | +|**cloneID** | **String** | | [optional] | +|**context** | **Map<String, String>** | | [optional] | +|**controllerRequired** | **Boolean** | | [optional] | +|**controllersExpected** | **Integer** | | [optional] | +|**controllersHealthy** | **Integer** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**externalID** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**mountOptions** | [**CSIMountOptions**](CSIMountOptions.md) | | [optional] | +|**name** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nodesExpected** | **Integer** | | [optional] | +|**nodesHealthy** | **Integer** | | [optional] | +|**parameters** | **Map<String, String>** | | [optional] | +|**pluginID** | **String** | | [optional] | +|**provider** | **String** | | [optional] | +|**providerVersion** | **String** | | [optional] | +|**readAllocs** | [**Map<String, Allocation>**](Allocation.md) | | [optional] | +|**requestedCapabilities** | [**List<CSIVolumeCapability>**](CSIVolumeCapability.md) | | [optional] | +|**requestedCapacityMax** | **Long** | | [optional] | +|**requestedCapacityMin** | **Long** | | [optional] | +|**requestedTopologies** | [**CSITopologyRequest**](CSITopologyRequest.md) | | [optional] | +|**resourceExhausted** | **OffsetDateTime** | | [optional] | +|**schedulable** | **Boolean** | | [optional] | +|**secrets** | **Map<String, String>** | | [optional] | +|**snapshotID** | **String** | | [optional] | +|**topologies** | [**List<CSITopology>**](CSITopology.md) | | [optional] | +|**writeAllocs** | [**Map<String, Allocation>**](Allocation.md) | | [optional] | diff --git a/clients/java/v1/docs/CSIVolumeCapability.md b/clients/java/v1/docs/CSIVolumeCapability.md index 3818be82..ae50052b 100644 --- a/clients/java/v1/docs/CSIVolumeCapability.md +++ b/clients/java/v1/docs/CSIVolumeCapability.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessMode** | **String** | | [optional] -**attachmentMode** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessMode** | **String** | | [optional] | +|**attachmentMode** | **String** | | [optional] | diff --git a/clients/java/v1/docs/CSIVolumeCreateRequest.md b/clients/java/v1/docs/CSIVolumeCreateRequest.md index 348734dd..8c4a2f73 100644 --- a/clients/java/v1/docs/CSIVolumeCreateRequest.md +++ b/clients/java/v1/docs/CSIVolumeCreateRequest.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**volumes** | [**List<CSIVolume>**](CSIVolume.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**volumes** | [**List<CSIVolume>**](CSIVolume.md) | | [optional] | diff --git a/clients/java/v1/docs/CSIVolumeExternalStub.md b/clients/java/v1/docs/CSIVolumeExternalStub.md index 5da65206..62fb2b4f 100644 --- a/clients/java/v1/docs/CSIVolumeExternalStub.md +++ b/clients/java/v1/docs/CSIVolumeExternalStub.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capacityBytes** | **Long** | | [optional] -**cloneID** | **String** | | [optional] -**externalID** | **String** | | [optional] -**isAbnormal** | **Boolean** | | [optional] -**publishedExternalNodeIDs** | **List<String>** | | [optional] -**snapshotID** | **String** | | [optional] -**status** | **String** | | [optional] -**volumeContext** | **Map<String, String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capacityBytes** | **Long** | | [optional] | +|**cloneID** | **String** | | [optional] | +|**externalID** | **String** | | [optional] | +|**isAbnormal** | **Boolean** | | [optional] | +|**publishedExternalNodeIDs** | **List<String>** | | [optional] | +|**snapshotID** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**volumeContext** | **Map<String, String>** | | [optional] | diff --git a/clients/java/v1/docs/CSIVolumeListExternalResponse.md b/clients/java/v1/docs/CSIVolumeListExternalResponse.md index e4b9dcbe..eeb13262 100644 --- a/clients/java/v1/docs/CSIVolumeListExternalResponse.md +++ b/clients/java/v1/docs/CSIVolumeListExternalResponse.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nextToken** | **String** | | [optional] -**volumes** | [**List<CSIVolumeExternalStub>**](CSIVolumeExternalStub.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nextToken** | **String** | | [optional] | +|**volumes** | [**List<CSIVolumeExternalStub>**](CSIVolumeExternalStub.md) | | [optional] | diff --git a/clients/java/v1/docs/CSIVolumeListStub.md b/clients/java/v1/docs/CSIVolumeListStub.md index e4be8f80..b8323886 100644 --- a/clients/java/v1/docs/CSIVolumeListStub.md +++ b/clients/java/v1/docs/CSIVolumeListStub.md @@ -5,26 +5,26 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessMode** | **String** | | [optional] -**attachmentMode** | **String** | | [optional] -**controllerRequired** | **Boolean** | | [optional] -**controllersExpected** | **Integer** | | [optional] -**controllersHealthy** | **Integer** | | [optional] -**createIndex** | **Integer** | | [optional] -**externalID** | **String** | | [optional] -**ID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**namespace** | **String** | | [optional] -**nodesExpected** | **Integer** | | [optional] -**nodesHealthy** | **Integer** | | [optional] -**pluginID** | **String** | | [optional] -**provider** | **String** | | [optional] -**resourceExhausted** | **OffsetDateTime** | | [optional] -**schedulable** | **Boolean** | | [optional] -**topologies** | [**List<CSITopology>**](CSITopology.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessMode** | **String** | | [optional] | +|**attachmentMode** | **String** | | [optional] | +|**controllerRequired** | **Boolean** | | [optional] | +|**controllersExpected** | **Integer** | | [optional] | +|**controllersHealthy** | **Integer** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**externalID** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nodesExpected** | **Integer** | | [optional] | +|**nodesHealthy** | **Integer** | | [optional] | +|**pluginID** | **String** | | [optional] | +|**provider** | **String** | | [optional] | +|**resourceExhausted** | **OffsetDateTime** | | [optional] | +|**schedulable** | **Boolean** | | [optional] | +|**topologies** | [**List<CSITopology>**](CSITopology.md) | | [optional] | diff --git a/clients/java/v1/docs/CSIVolumeRegisterRequest.md b/clients/java/v1/docs/CSIVolumeRegisterRequest.md index b09be2a0..ac367698 100644 --- a/clients/java/v1/docs/CSIVolumeRegisterRequest.md +++ b/clients/java/v1/docs/CSIVolumeRegisterRequest.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**volumes** | [**List<CSIVolume>**](CSIVolume.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**volumes** | [**List<CSIVolume>**](CSIVolume.md) | | [optional] | diff --git a/clients/java/v1/docs/CheckRestart.md b/clients/java/v1/docs/CheckRestart.md index b1e6d146..a2e707a5 100644 --- a/clients/java/v1/docs/CheckRestart.md +++ b/clients/java/v1/docs/CheckRestart.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**grace** | **Long** | | [optional] -**ignoreWarnings** | **Boolean** | | [optional] -**limit** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**grace** | **Long** | | [optional] | +|**ignoreWarnings** | **Boolean** | | [optional] | +|**limit** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/Constraint.md b/clients/java/v1/docs/Constraint.md index 33e8b63a..1a29a905 100644 --- a/clients/java/v1/docs/Constraint.md +++ b/clients/java/v1/docs/Constraint.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ltarget** | **String** | | [optional] -**operand** | **String** | | [optional] -**rtarget** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ltarget** | **String** | | [optional] | +|**operand** | **String** | | [optional] | +|**rtarget** | **String** | | [optional] | diff --git a/clients/java/v1/docs/Consul.md b/clients/java/v1/docs/Consul.md index 37ab7b81..ebb73bc3 100644 --- a/clients/java/v1/docs/Consul.md +++ b/clients/java/v1/docs/Consul.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**namespace** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ConsulConnect.md b/clients/java/v1/docs/ConsulConnect.md index bb7d4939..0adac7e0 100644 --- a/clients/java/v1/docs/ConsulConnect.md +++ b/clients/java/v1/docs/ConsulConnect.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**gateway** | [**ConsulGateway**](ConsulGateway.md) | | [optional] -**_native** | **Boolean** | | [optional] -**sidecarService** | [**ConsulSidecarService**](ConsulSidecarService.md) | | [optional] -**sidecarTask** | [**SidecarTask**](SidecarTask.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**gateway** | [**ConsulGateway**](ConsulGateway.md) | | [optional] | +|**_native** | **Boolean** | | [optional] | +|**sidecarService** | [**ConsulSidecarService**](ConsulSidecarService.md) | | [optional] | +|**sidecarTask** | [**SidecarTask**](SidecarTask.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulExposeConfig.md b/clients/java/v1/docs/ConsulExposeConfig.md index 1e65a73e..dce5e832 100644 --- a/clients/java/v1/docs/ConsulExposeConfig.md +++ b/clients/java/v1/docs/ConsulExposeConfig.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**path** | [**List<ConsulExposePath>**](ConsulExposePath.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**path** | [**List<ConsulExposePath>**](ConsulExposePath.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulExposePath.md b/clients/java/v1/docs/ConsulExposePath.md index 0f483dbd..fbee70f2 100644 --- a/clients/java/v1/docs/ConsulExposePath.md +++ b/clients/java/v1/docs/ConsulExposePath.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**listenerPort** | **String** | | [optional] -**localPathPort** | **Integer** | | [optional] -**path** | **String** | | [optional] -**protocol** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**listenerPort** | **String** | | [optional] | +|**localPathPort** | **Integer** | | [optional] | +|**path** | **String** | | [optional] | +|**protocol** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ConsulGateway.md b/clients/java/v1/docs/ConsulGateway.md index 436911ee..2591aeab 100644 --- a/clients/java/v1/docs/ConsulGateway.md +++ b/clients/java/v1/docs/ConsulGateway.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ingress** | [**ConsulIngressConfigEntry**](ConsulIngressConfigEntry.md) | | [optional] -**mesh** | **Object** | | [optional] -**proxy** | [**ConsulGatewayProxy**](ConsulGatewayProxy.md) | | [optional] -**terminating** | [**ConsulTerminatingConfigEntry**](ConsulTerminatingConfigEntry.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ingress** | [**ConsulIngressConfigEntry**](ConsulIngressConfigEntry.md) | | [optional] | +|**mesh** | **Object** | | [optional] | +|**proxy** | [**ConsulGatewayProxy**](ConsulGatewayProxy.md) | | [optional] | +|**terminating** | [**ConsulTerminatingConfigEntry**](ConsulTerminatingConfigEntry.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulGatewayBindAddress.md b/clients/java/v1/docs/ConsulGatewayBindAddress.md index 18a49b69..17097fa1 100644 --- a/clients/java/v1/docs/ConsulGatewayBindAddress.md +++ b/clients/java/v1/docs/ConsulGatewayBindAddress.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address** | **String** | | [optional] -**name** | **String** | | [optional] -**port** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**address** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**port** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/ConsulGatewayProxy.md b/clients/java/v1/docs/ConsulGatewayProxy.md index 88c4ed68..2b8a3091 100644 --- a/clients/java/v1/docs/ConsulGatewayProxy.md +++ b/clients/java/v1/docs/ConsulGatewayProxy.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**config** | **Map<String, Object>** | | [optional] -**connectTimeout** | **Long** | | [optional] -**envoyDNSDiscoveryType** | **String** | | [optional] -**envoyGatewayBindAddresses** | [**Map<String, ConsulGatewayBindAddress>**](ConsulGatewayBindAddress.md) | | [optional] -**envoyGatewayBindTaggedAddresses** | **Boolean** | | [optional] -**envoyGatewayNoDefaultBind** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**config** | **Map<String, Object>** | | [optional] | +|**connectTimeout** | **Long** | | [optional] | +|**envoyDNSDiscoveryType** | **String** | | [optional] | +|**envoyGatewayBindAddresses** | [**Map<String, ConsulGatewayBindAddress>**](ConsulGatewayBindAddress.md) | | [optional] | +|**envoyGatewayBindTaggedAddresses** | **Boolean** | | [optional] | +|**envoyGatewayNoDefaultBind** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/ConsulGatewayTLSConfig.md b/clients/java/v1/docs/ConsulGatewayTLSConfig.md index 6280d312..d5b7d009 100644 --- a/clients/java/v1/docs/ConsulGatewayTLSConfig.md +++ b/clients/java/v1/docs/ConsulGatewayTLSConfig.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cipherSuites** | **List<String>** | | [optional] -**enabled** | **Boolean** | | [optional] -**tlSMaxVersion** | **String** | | [optional] -**tlSMinVersion** | **String** | | [optional] +| Name | Type | Description | Notes | +| ----------------- | ---------------------- | ----------- | ---------- | +| **cipherSuites** | **List<String>** | | [optional] | +| **enabled** | **Boolean** | | [optional] | +| **tlSMaxVersion** | **String** | | [optional] | +| **tlSMinVersion** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ConsulIngressConfigEntry.md b/clients/java/v1/docs/ConsulIngressConfigEntry.md index 8346f60c..7a6fba3a 100644 --- a/clients/java/v1/docs/ConsulIngressConfigEntry.md +++ b/clients/java/v1/docs/ConsulIngressConfigEntry.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**listeners** | [**List<ConsulIngressListener>**](ConsulIngressListener.md) | | [optional] -**TLS** | [**ConsulGatewayTLSConfig**](ConsulGatewayTLSConfig.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**listeners** | [**List<ConsulIngressListener>**](ConsulIngressListener.md) | | [optional] | +|**TLS** | [**ConsulGatewayTLSConfig**](ConsulGatewayTLSConfig.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulIngressListener.md b/clients/java/v1/docs/ConsulIngressListener.md index 46f01fa8..0886eaaf 100644 --- a/clients/java/v1/docs/ConsulIngressListener.md +++ b/clients/java/v1/docs/ConsulIngressListener.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**port** | **Integer** | | [optional] -**protocol** | **String** | | [optional] -**services** | [**List<ConsulIngressService>**](ConsulIngressService.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**port** | **Integer** | | [optional] | +|**protocol** | **String** | | [optional] | +|**services** | [**List<ConsulIngressService>**](ConsulIngressService.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulIngressService.md b/clients/java/v1/docs/ConsulIngressService.md index e42b4b3c..71dc166e 100644 --- a/clients/java/v1/docs/ConsulIngressService.md +++ b/clients/java/v1/docs/ConsulIngressService.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hosts** | **List<String>** | | [optional] -**name** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hosts** | **List<String>** | | [optional] | +|**name** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ConsulLinkedService.md b/clients/java/v1/docs/ConsulLinkedService.md index 4543a250..412d608b 100644 --- a/clients/java/v1/docs/ConsulLinkedService.md +++ b/clients/java/v1/docs/ConsulLinkedService.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**caFile** | **String** | | [optional] -**certFile** | **String** | | [optional] -**keyFile** | **String** | | [optional] -**name** | **String** | | [optional] -**SNI** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**caFile** | **String** | | [optional] | +|**certFile** | **String** | | [optional] | +|**keyFile** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**SNI** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ConsulMeshGateway.md b/clients/java/v1/docs/ConsulMeshGateway.md index 5f306a25..ac491ebc 100644 --- a/clients/java/v1/docs/ConsulMeshGateway.md +++ b/clients/java/v1/docs/ConsulMeshGateway.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mode** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mode** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ConsulProxy.md b/clients/java/v1/docs/ConsulProxy.md index 2ade6e72..baf03440 100644 --- a/clients/java/v1/docs/ConsulProxy.md +++ b/clients/java/v1/docs/ConsulProxy.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**config** | **Map<String, Object>** | | [optional] -**exposeConfig** | [**ConsulExposeConfig**](ConsulExposeConfig.md) | | [optional] -**localServiceAddress** | **String** | | [optional] -**localServicePort** | **Integer** | | [optional] -**upstreams** | [**List<ConsulUpstream>**](ConsulUpstream.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**config** | **Map<String, Object>** | | [optional] | +|**exposeConfig** | [**ConsulExposeConfig**](ConsulExposeConfig.md) | | [optional] | +|**localServiceAddress** | **String** | | [optional] | +|**localServicePort** | **Integer** | | [optional] | +|**upstreams** | [**List<ConsulUpstream>**](ConsulUpstream.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulSidecarService.md b/clients/java/v1/docs/ConsulSidecarService.md index 0c289bdb..c254d5b1 100644 --- a/clients/java/v1/docs/ConsulSidecarService.md +++ b/clients/java/v1/docs/ConsulSidecarService.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disableDefaultTCPCheck** | **Boolean** | | [optional] -**port** | **String** | | [optional] -**proxy** | [**ConsulProxy**](ConsulProxy.md) | | [optional] -**tags** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**disableDefaultTCPCheck** | **Boolean** | | [optional] | +|**port** | **String** | | [optional] | +|**proxy** | [**ConsulProxy**](ConsulProxy.md) | | [optional] | +|**tags** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/ConsulTerminatingConfigEntry.md b/clients/java/v1/docs/ConsulTerminatingConfigEntry.md index 02a50ff9..56a55b6e 100644 --- a/clients/java/v1/docs/ConsulTerminatingConfigEntry.md +++ b/clients/java/v1/docs/ConsulTerminatingConfigEntry.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**services** | [**List<ConsulLinkedService>**](ConsulLinkedService.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**services** | [**List<ConsulLinkedService>**](ConsulLinkedService.md) | | [optional] | diff --git a/clients/java/v1/docs/ConsulUpstream.md b/clients/java/v1/docs/ConsulUpstream.md index 6682def6..0e015335 100644 --- a/clients/java/v1/docs/ConsulUpstream.md +++ b/clients/java/v1/docs/ConsulUpstream.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**datacenter** | **String** | | [optional] -**destinationName** | **String** | | [optional] -**destinationNamespace** | **String** | | [optional] -**localBindAddress** | **String** | | [optional] -**localBindPort** | **Integer** | | [optional] -**meshGateway** | [**ConsulMeshGateway**](ConsulMeshGateway.md) | | [optional] +| Name | Type | Description | Notes | +| ------------------------ | --------------------------------------------- | ----------- | ---------- | +| **datacenter** | **String** | | [optional] | +| **destinationName** | **String** | | [optional] | +| **destinationNamespace** | **String** | | [optional] | +| **localBindAddress** | **String** | | [optional] | +| **localBindPort** | **Integer** | | [optional] | +| **meshGateway** | [**ConsulMeshGateway**](ConsulMeshGateway.md) | | [optional] | diff --git a/clients/java/v1/docs/DNSConfig.md b/clients/java/v1/docs/DNSConfig.md index b33b87f3..e258b190 100644 --- a/clients/java/v1/docs/DNSConfig.md +++ b/clients/java/v1/docs/DNSConfig.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**options** | **List<String>** | | [optional] -**searches** | **List<String>** | | [optional] -**servers** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**options** | **List<String>** | | [optional] | +|**searches** | **List<String>** | | [optional] | +|**servers** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/Deployment.md b/clients/java/v1/docs/Deployment.md index 1d32b82a..aecb7c8f 100644 --- a/clients/java/v1/docs/Deployment.md +++ b/clients/java/v1/docs/Deployment.md @@ -5,21 +5,21 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**ID** | **String** | | [optional] -**isMultiregion** | **Boolean** | | [optional] -**jobCreateIndex** | **Integer** | | [optional] -**jobID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**jobSpecModifyIndex** | **Integer** | | [optional] -**jobVersion** | **Integer** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**taskGroups** | [**Map<String, DeploymentState>**](DeploymentState.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**ID** | **String** | | [optional] | +|**isMultiregion** | **Boolean** | | [optional] | +|**jobCreateIndex** | **Integer** | | [optional] | +|**jobID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**jobSpecModifyIndex** | **Integer** | | [optional] | +|**jobVersion** | **Integer** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**taskGroups** | [**Map<String, DeploymentState>**](DeploymentState.md) | | [optional] | diff --git a/clients/java/v1/docs/DeploymentAllocHealthRequest.md b/clients/java/v1/docs/DeploymentAllocHealthRequest.md index a2679c63..18de320f 100644 --- a/clients/java/v1/docs/DeploymentAllocHealthRequest.md +++ b/clients/java/v1/docs/DeploymentAllocHealthRequest.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deploymentID** | **String** | | [optional] -**healthyAllocationIDs** | **List<String>** | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**unhealthyAllocationIDs** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deploymentID** | **String** | | [optional] | +|**healthyAllocationIDs** | **List<String>** | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**unhealthyAllocationIDs** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/DeploymentPauseRequest.md b/clients/java/v1/docs/DeploymentPauseRequest.md index 31a5bac8..3751aad1 100644 --- a/clients/java/v1/docs/DeploymentPauseRequest.md +++ b/clients/java/v1/docs/DeploymentPauseRequest.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deploymentID** | **String** | | [optional] -**namespace** | **String** | | [optional] -**pause** | **Boolean** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deploymentID** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**pause** | **Boolean** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/DeploymentPromoteRequest.md b/clients/java/v1/docs/DeploymentPromoteRequest.md index 8aa5ec49..b1d8f42e 100644 --- a/clients/java/v1/docs/DeploymentPromoteRequest.md +++ b/clients/java/v1/docs/DeploymentPromoteRequest.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**all** | **Boolean** | | [optional] -**deploymentID** | **String** | | [optional] -**groups** | **List<String>** | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**all** | **Boolean** | | [optional] | +|**deploymentID** | **String** | | [optional] | +|**groups** | **List<String>** | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/DeploymentState.md b/clients/java/v1/docs/DeploymentState.md index 9d5a0ff2..6fba0e3c 100644 --- a/clients/java/v1/docs/DeploymentState.md +++ b/clients/java/v1/docs/DeploymentState.md @@ -5,18 +5,18 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**autoRevert** | **Boolean** | | [optional] -**desiredCanaries** | **Integer** | | [optional] -**desiredTotal** | **Integer** | | [optional] -**healthyAllocs** | **Integer** | | [optional] -**placedAllocs** | **Integer** | | [optional] -**placedCanaries** | **List<String>** | | [optional] -**progressDeadline** | **Long** | | [optional] -**promoted** | **Boolean** | | [optional] -**requireProgressBy** | **OffsetDateTime** | | [optional] -**unhealthyAllocs** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**autoRevert** | **Boolean** | | [optional] | +|**desiredCanaries** | **Integer** | | [optional] | +|**desiredTotal** | **Integer** | | [optional] | +|**healthyAllocs** | **Integer** | | [optional] | +|**placedAllocs** | **Integer** | | [optional] | +|**placedCanaries** | **List<String>** | | [optional] | +|**progressDeadline** | **Long** | | [optional] | +|**promoted** | **Boolean** | | [optional] | +|**requireProgressBy** | **OffsetDateTime** | | [optional] | +|**unhealthyAllocs** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/DeploymentUnblockRequest.md b/clients/java/v1/docs/DeploymentUnblockRequest.md index 67ad499c..90a3fb04 100644 --- a/clients/java/v1/docs/DeploymentUnblockRequest.md +++ b/clients/java/v1/docs/DeploymentUnblockRequest.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deploymentID** | **String** | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deploymentID** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/DeploymentUpdateResponse.md b/clients/java/v1/docs/DeploymentUpdateResponse.md index ce033a2e..57ecc519 100644 --- a/clients/java/v1/docs/DeploymentUpdateResponse.md +++ b/clients/java/v1/docs/DeploymentUpdateResponse.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deploymentModifyIndex** | **Integer** | | [optional] -**evalCreateIndex** | **Integer** | | [optional] -**evalID** | **String** | | [optional] -**lastIndex** | **Integer** | | [optional] -**requestTime** | **Long** | | [optional] -**revertedJobVersion** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deploymentModifyIndex** | **Integer** | | [optional] | +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalID** | **String** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**revertedJobVersion** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/DeploymentsApi.md b/clients/java/v1/docs/DeploymentsApi.md index 89b8a501..796a04fd 100644 --- a/clients/java/v1/docs/DeploymentsApi.md +++ b/clients/java/v1/docs/DeploymentsApi.md @@ -2,16 +2,16 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getDeployment**](DeploymentsApi.md#getDeployment) | **GET** /deployment/{deploymentID} | -[**getDeploymentAllocations**](DeploymentsApi.md#getDeploymentAllocations) | **GET** /deployment/allocations/{deploymentID} | -[**getDeployments**](DeploymentsApi.md#getDeployments) | **GET** /deployments | -[**postDeploymentAllocationHealth**](DeploymentsApi.md#postDeploymentAllocationHealth) | **POST** /deployment/allocation-health/{deploymentID} | -[**postDeploymentFail**](DeploymentsApi.md#postDeploymentFail) | **POST** /deployment/fail/{deploymentID} | -[**postDeploymentPause**](DeploymentsApi.md#postDeploymentPause) | **POST** /deployment/pause/{deploymentID} | -[**postDeploymentPromote**](DeploymentsApi.md#postDeploymentPromote) | **POST** /deployment/promote/{deploymentID} | -[**postDeploymentUnblock**](DeploymentsApi.md#postDeploymentUnblock) | **POST** /deployment/unblock/{deploymentID} | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getDeployment**](DeploymentsApi.md#getDeployment) | **GET** /deployment/{deploymentID} | | +| [**getDeploymentAllocations**](DeploymentsApi.md#getDeploymentAllocations) | **GET** /deployment/allocations/{deploymentID} | | +| [**getDeployments**](DeploymentsApi.md#getDeployments) | **GET** /deployments | | +| [**postDeploymentAllocationHealth**](DeploymentsApi.md#postDeploymentAllocationHealth) | **POST** /deployment/allocation-health/{deploymentID} | | +| [**postDeploymentFail**](DeploymentsApi.md#postDeploymentFail) | **POST** /deployment/fail/{deploymentID} | | +| [**postDeploymentPause**](DeploymentsApi.md#postDeploymentPause) | **POST** /deployment/pause/{deploymentID} | | +| [**postDeploymentPromote**](DeploymentsApi.md#postDeploymentPromote) | **POST** /deployment/promote/{deploymentID} | | +| [**postDeploymentUnblock**](DeploymentsApi.md#postDeploymentUnblock) | **POST** /deployment/unblock/{deploymentID} | | @@ -68,18 +68,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -97,11 +97,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getDeploymentAllocations** @@ -157,18 +157,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -186,11 +186,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getDeployments** @@ -245,17 +245,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -273,11 +273,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postDeploymentAllocationHealth** @@ -329,14 +329,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **deploymentAllocHealthRequest** | [**DeploymentAllocHealthRequest**](DeploymentAllocHealthRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **deploymentAllocHealthRequest** | [**DeploymentAllocHealthRequest**](DeploymentAllocHealthRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -354,11 +354,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postDeploymentFail** @@ -409,13 +409,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -433,11 +433,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postDeploymentPause** @@ -489,14 +489,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **deploymentPauseRequest** | [**DeploymentPauseRequest**](DeploymentPauseRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **deploymentPauseRequest** | [**DeploymentPauseRequest**](DeploymentPauseRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -514,11 +514,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postDeploymentPromote** @@ -570,14 +570,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **deploymentPromoteRequest** | [**DeploymentPromoteRequest**](DeploymentPromoteRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **deploymentPromoteRequest** | [**DeploymentPromoteRequest**](DeploymentPromoteRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -595,11 +595,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postDeploymentUnblock** @@ -651,14 +651,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **deploymentID** | **String**| Deployment ID. | - **deploymentUnblockRequest** | [**DeploymentUnblockRequest**](DeploymentUnblockRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deploymentID** | **String**| Deployment ID. | | +| **deploymentUnblockRequest** | [**DeploymentUnblockRequest**](DeploymentUnblockRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -676,9 +676,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/DesiredTransition.md b/clients/java/v1/docs/DesiredTransition.md index 3594ce99..485c88a2 100644 --- a/clients/java/v1/docs/DesiredTransition.md +++ b/clients/java/v1/docs/DesiredTransition.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**migrate** | **Boolean** | | [optional] -**reschedule** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**migrate** | **Boolean** | | [optional] | +|**reschedule** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/DesiredUpdates.md b/clients/java/v1/docs/DesiredUpdates.md index f2d5524b..6fc6e844 100644 --- a/clients/java/v1/docs/DesiredUpdates.md +++ b/clients/java/v1/docs/DesiredUpdates.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**canary** | **Integer** | | [optional] -**destructiveUpdate** | **Integer** | | [optional] -**ignore** | **Integer** | | [optional] -**inPlaceUpdate** | **Integer** | | [optional] -**migrate** | **Integer** | | [optional] -**place** | **Integer** | | [optional] -**preemptions** | **Integer** | | [optional] -**stop** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**canary** | **Integer** | | [optional] | +|**destructiveUpdate** | **Integer** | | [optional] | +|**ignore** | **Integer** | | [optional] | +|**inPlaceUpdate** | **Integer** | | [optional] | +|**migrate** | **Integer** | | [optional] | +|**place** | **Integer** | | [optional] | +|**preemptions** | **Integer** | | [optional] | +|**stop** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/DispatchPayloadConfig.md b/clients/java/v1/docs/DispatchPayloadConfig.md index 1c5f0c37..81a3e5d1 100644 --- a/clients/java/v1/docs/DispatchPayloadConfig.md +++ b/clients/java/v1/docs/DispatchPayloadConfig.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | **String** | | [optional] | diff --git a/clients/java/v1/docs/DrainMetadata.md b/clients/java/v1/docs/DrainMetadata.md index ce462f8b..e775437d 100644 --- a/clients/java/v1/docs/DrainMetadata.md +++ b/clients/java/v1/docs/DrainMetadata.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessorID** | **String** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**startedAt** | **OffsetDateTime** | | [optional] -**status** | **String** | | [optional] -**updatedAt** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessorID** | **String** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**startedAt** | **OffsetDateTime** | | [optional] | +|**status** | **String** | | [optional] | +|**updatedAt** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/DrainSpec.md b/clients/java/v1/docs/DrainSpec.md index 860ca2cd..94d39b1e 100644 --- a/clients/java/v1/docs/DrainSpec.md +++ b/clients/java/v1/docs/DrainSpec.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deadline** | **Long** | | [optional] -**ignoreSystemJobs** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deadline** | **Long** | | [optional] | +|**ignoreSystemJobs** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/DrainStrategy.md b/clients/java/v1/docs/DrainStrategy.md index dcf51ac4..931ddb10 100644 --- a/clients/java/v1/docs/DrainStrategy.md +++ b/clients/java/v1/docs/DrainStrategy.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deadline** | **Long** | | [optional] -**forceDeadline** | **OffsetDateTime** | | [optional] -**ignoreSystemJobs** | **Boolean** | | [optional] -**startedAt** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deadline** | **Long** | | [optional] | +|**forceDeadline** | **OffsetDateTime** | | [optional] | +|**ignoreSystemJobs** | **Boolean** | | [optional] | +|**startedAt** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/DriverInfo.md b/clients/java/v1/docs/DriverInfo.md index 5de19fab..2baf017b 100644 --- a/clients/java/v1/docs/DriverInfo.md +++ b/clients/java/v1/docs/DriverInfo.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | **Map<String, String>** | | [optional] -**detected** | **Boolean** | | [optional] -**healthDescription** | **String** | | [optional] -**healthy** | **Boolean** | | [optional] -**updateTime** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**attributes** | **Map<String, String>** | | [optional] | +|**detected** | **Boolean** | | [optional] | +|**healthDescription** | **String** | | [optional] | +|**healthy** | **Boolean** | | [optional] | +|**updateTime** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/EnterpriseApi.md b/clients/java/v1/docs/EnterpriseApi.md index 8786c268..a644f30d 100644 --- a/clients/java/v1/docs/EnterpriseApi.md +++ b/clients/java/v1/docs/EnterpriseApi.md @@ -2,13 +2,13 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createQuotaSpec**](EnterpriseApi.md#createQuotaSpec) | **POST** /quota | -[**deleteQuotaSpec**](EnterpriseApi.md#deleteQuotaSpec) | **DELETE** /quota/{specName} | -[**getQuotaSpec**](EnterpriseApi.md#getQuotaSpec) | **GET** /quota/{specName} | -[**getQuotas**](EnterpriseApi.md#getQuotas) | **GET** /quotas | -[**postQuotaSpec**](EnterpriseApi.md#postQuotaSpec) | **POST** /quota/{specName} | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createQuotaSpec**](EnterpriseApi.md#createQuotaSpec) | **POST** /quota | | +| [**deleteQuotaSpec**](EnterpriseApi.md#deleteQuotaSpec) | **DELETE** /quota/{specName} | | +| [**getQuotaSpec**](EnterpriseApi.md#getQuotaSpec) | **GET** /quota/{specName} | | +| [**getQuotas**](EnterpriseApi.md#getQuotas) | **GET** /quotas | | +| [**postQuotaSpec**](EnterpriseApi.md#postQuotaSpec) | **POST** /quota/{specName} | | @@ -59,13 +59,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **quotaSpec** | [**QuotaSpec**](QuotaSpec.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **quotaSpec** | [**QuotaSpec**](QuotaSpec.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -83,11 +83,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **deleteQuotaSpec** @@ -137,13 +137,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **specName** | **String**| The quota spec identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **specName** | **String**| The quota spec identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -161,11 +161,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getQuotaSpec** @@ -221,18 +221,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **specName** | **String**| The quota spec identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **specName** | **String**| The quota spec identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -250,11 +250,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getQuotas** @@ -309,17 +309,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -337,11 +337,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postQuotaSpec** @@ -392,14 +392,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **specName** | **String**| The quota spec identifier. | - **quotaSpec** | [**QuotaSpec**](QuotaSpec.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **specName** | **String**| The quota spec identifier. | | +| **quotaSpec** | [**QuotaSpec**](QuotaSpec.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -417,9 +417,9 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/EphemeralDisk.md b/clients/java/v1/docs/EphemeralDisk.md index 9cb7bc23..1cc0eb16 100644 --- a/clients/java/v1/docs/EphemeralDisk.md +++ b/clients/java/v1/docs/EphemeralDisk.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**migrate** | **Boolean** | | [optional] -**sizeMB** | **Integer** | | [optional] -**sticky** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**migrate** | **Boolean** | | [optional] | +|**sizeMB** | **Integer** | | [optional] | +|**sticky** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/EvalOptions.md b/clients/java/v1/docs/EvalOptions.md index a5226cc9..ea77938b 100644 --- a/clients/java/v1/docs/EvalOptions.md +++ b/clients/java/v1/docs/EvalOptions.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**forceReschedule** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**forceReschedule** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/Evaluation.md b/clients/java/v1/docs/Evaluation.md index 5dc7d062..8e83db03 100644 --- a/clients/java/v1/docs/Evaluation.md +++ b/clients/java/v1/docs/Evaluation.md @@ -5,37 +5,37 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**annotatePlan** | **Boolean** | | [optional] -**blockedEval** | **String** | | [optional] -**classEligibility** | **Map<String, Boolean>** | | [optional] -**createIndex** | **Integer** | | [optional] -**createTime** | **Long** | | [optional] -**deploymentID** | **String** | | [optional] -**escapedComputedClass** | **Boolean** | | [optional] -**failedTGAllocs** | [**Map<String, AllocationMetric>**](AllocationMetric.md) | | [optional] -**ID** | **String** | | [optional] -**jobID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**modifyTime** | **Long** | | [optional] -**namespace** | **String** | | [optional] -**nextEval** | **String** | | [optional] -**nodeID** | **String** | | [optional] -**nodeModifyIndex** | **Integer** | | [optional] -**previousEval** | **String** | | [optional] -**priority** | **Integer** | | [optional] -**queuedAllocations** | **Map<String, Integer>** | | [optional] -**quotaLimitReached** | **String** | | [optional] -**relatedEvals** | [**List<EvaluationStub>**](EvaluationStub.md) | | [optional] -**snapshotIndex** | **Integer** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**triggeredBy** | **String** | | [optional] -**type** | **String** | | [optional] -**wait** | **Long** | | [optional] -**waitUntil** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**annotatePlan** | **Boolean** | | [optional] | +|**blockedEval** | **String** | | [optional] | +|**classEligibility** | **Map<String, Boolean>** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**deploymentID** | **String** | | [optional] | +|**escapedComputedClass** | **Boolean** | | [optional] | +|**failedTGAllocs** | [**Map<String, AllocationMetric>**](AllocationMetric.md) | | [optional] | +|**ID** | **String** | | [optional] | +|**jobID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**modifyTime** | **Long** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nextEval** | **String** | | [optional] | +|**nodeID** | **String** | | [optional] | +|**nodeModifyIndex** | **Integer** | | [optional] | +|**previousEval** | **String** | | [optional] | +|**priority** | **Integer** | | [optional] | +|**queuedAllocations** | **Map<String, Integer>** | | [optional] | +|**quotaLimitReached** | **String** | | [optional] | +|**relatedEvals** | [**List<EvaluationStub>**](EvaluationStub.md) | | [optional] | +|**snapshotIndex** | **Integer** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**triggeredBy** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**wait** | **Long** | | [optional] | +|**waitUntil** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/EvaluationStub.md b/clients/java/v1/docs/EvaluationStub.md index ff71ba54..d8e4c569 100644 --- a/clients/java/v1/docs/EvaluationStub.md +++ b/clients/java/v1/docs/EvaluationStub.md @@ -5,26 +5,26 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**blockedEval** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**createTime** | **Long** | | [optional] -**deploymentID** | **String** | | [optional] -**ID** | **String** | | [optional] -**jobID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**modifyTime** | **Long** | | [optional] -**namespace** | **String** | | [optional] -**nextEval** | **String** | | [optional] -**nodeID** | **String** | | [optional] -**previousEval** | **String** | | [optional] -**priority** | **Integer** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**triggeredBy** | **String** | | [optional] -**type** | **String** | | [optional] -**waitUntil** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**blockedEval** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**deploymentID** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**jobID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**modifyTime** | **Long** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nextEval** | **String** | | [optional] | +|**nodeID** | **String** | | [optional] | +|**previousEval** | **String** | | [optional] | +|**priority** | **Integer** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**triggeredBy** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**waitUntil** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/EvaluationsApi.md b/clients/java/v1/docs/EvaluationsApi.md index c45b7f72..e5fa0342 100644 --- a/clients/java/v1/docs/EvaluationsApi.md +++ b/clients/java/v1/docs/EvaluationsApi.md @@ -2,11 +2,11 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getEvaluation**](EvaluationsApi.md#getEvaluation) | **GET** /evaluation/{evalID} | -[**getEvaluationAllocations**](EvaluationsApi.md#getEvaluationAllocations) | **GET** /evaluation/{evalID}/allocations | -[**getEvaluations**](EvaluationsApi.md#getEvaluations) | **GET** /evaluations | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getEvaluation**](EvaluationsApi.md#getEvaluation) | **GET** /evaluation/{evalID} | | +| [**getEvaluationAllocations**](EvaluationsApi.md#getEvaluationAllocations) | **GET** /evaluation/{evalID}/allocations | | +| [**getEvaluations**](EvaluationsApi.md#getEvaluations) | **GET** /evaluations | | @@ -63,18 +63,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **evalID** | **String**| Evaluation ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **evalID** | **String**| Evaluation ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -92,11 +92,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getEvaluationAllocations** @@ -152,18 +152,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **evalID** | **String**| Evaluation ID. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **evalID** | **String**| Evaluation ID. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -181,11 +181,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getEvaluations** @@ -240,17 +240,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -268,9 +268,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/FieldDiff.md b/clients/java/v1/docs/FieldDiff.md index 20eb4f2d..026b009b 100644 --- a/clients/java/v1/docs/FieldDiff.md +++ b/clients/java/v1/docs/FieldDiff.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**annotations** | **List<String>** | | [optional] -**name** | **String** | | [optional] -**_new** | **String** | | [optional] -**old** | **String** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**annotations** | **List<String>** | | [optional] | +|**name** | **String** | | [optional] | +|**_new** | **String** | | [optional] | +|**old** | **String** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/FuzzyMatch.md b/clients/java/v1/docs/FuzzyMatch.md index 051b0d68..a21d45c1 100644 --- a/clients/java/v1/docs/FuzzyMatch.md +++ b/clients/java/v1/docs/FuzzyMatch.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ID** | **String** | | [optional] -**scope** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ID** | **String** | | [optional] | +|**scope** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/FuzzySearchRequest.md b/clients/java/v1/docs/FuzzySearchRequest.md index 76913a8e..8e7d7180 100644 --- a/clients/java/v1/docs/FuzzySearchRequest.md +++ b/clients/java/v1/docs/FuzzySearchRequest.md @@ -5,23 +5,23 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allowStale** | **Boolean** | | [optional] -**authToken** | **String** | | [optional] -**context** | **String** | | [optional] -**filter** | **String** | | [optional] -**headers** | **Map<String, String>** | | [optional] -**namespace** | **String** | | [optional] -**nextToken** | **String** | | [optional] -**params** | **Map<String, String>** | | [optional] -**perPage** | **Integer** | | [optional] -**prefix** | **String** | | [optional] -**region** | **String** | | [optional] -**reverse** | **Boolean** | | [optional] -**text** | **String** | | [optional] -**waitIndex** | **Integer** | | [optional] -**waitTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allowStale** | **Boolean** | | [optional] | +|**authToken** | **String** | | [optional] | +|**context** | **String** | | [optional] | +|**filter** | **String** | | [optional] | +|**headers** | **Map<String, String>** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**params** | **Map<String, String>** | | [optional] | +|**perPage** | **Integer** | | [optional] | +|**prefix** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**reverse** | **Boolean** | | [optional] | +|**text** | **String** | | [optional] | +|**waitIndex** | **Integer** | | [optional] | +|**waitTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/FuzzySearchResponse.md b/clients/java/v1/docs/FuzzySearchResponse.md index 86dae65b..c49c8f76 100644 --- a/clients/java/v1/docs/FuzzySearchResponse.md +++ b/clients/java/v1/docs/FuzzySearchResponse.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**matches** | **Map<String, List<FuzzyMatch>>** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**truncations** | **Map<String, Boolean>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**matches** | **Map<String, List<FuzzyMatch>>** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**truncations** | **Map<String, Boolean>** | | [optional] | diff --git a/clients/java/v1/docs/GaugeValue.md b/clients/java/v1/docs/GaugeValue.md index ac294107..52350221 100644 --- a/clients/java/v1/docs/GaugeValue.md +++ b/clients/java/v1/docs/GaugeValue.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**labels** | **Map<String, String>** | | [optional] -**name** | **String** | | [optional] -**value** | **Float** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**labels** | **Map<String, String>** | | [optional] | +|**name** | **String** | | [optional] | +|**value** | **Float** | | [optional] | diff --git a/clients/java/v1/docs/HostNetworkInfo.md b/clients/java/v1/docs/HostNetworkInfo.md index 29b512b4..06b7981e 100644 --- a/clients/java/v1/docs/HostNetworkInfo.md +++ b/clients/java/v1/docs/HostNetworkInfo.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CIDR** | **String** | | [optional] -**_interface** | **String** | | [optional] -**name** | **String** | | [optional] -**reservedPorts** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**CIDR** | **String** | | [optional] | +|**_interface** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**reservedPorts** | **String** | | [optional] | diff --git a/clients/java/v1/docs/HostVolumeInfo.md b/clients/java/v1/docs/HostVolumeInfo.md index 927995ef..556b9b4f 100644 --- a/clients/java/v1/docs/HostVolumeInfo.md +++ b/clients/java/v1/docs/HostVolumeInfo.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**path** | **String** | | [optional] -**readOnly** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**path** | **String** | | [optional] | +|**readOnly** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/Job.md b/clients/java/v1/docs/Job.md index 2b337b6e..8abe94ce 100644 --- a/clients/java/v1/docs/Job.md +++ b/clients/java/v1/docs/Job.md @@ -5,45 +5,45 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] -**allAtOnce** | **Boolean** | | [optional] -**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] -**consulNamespace** | **String** | | [optional] -**consulToken** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**datacenters** | **List<String>** | | [optional] -**dispatchIdempotencyToken** | **String** | | [optional] -**dispatched** | **Boolean** | | [optional] -**ID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**migrate** | [**MigrateStrategy**](MigrateStrategy.md) | | [optional] -**modifyIndex** | **Integer** | | [optional] -**multiregion** | [**Multiregion**](Multiregion.md) | | [optional] -**name** | **String** | | [optional] -**namespace** | **String** | | [optional] -**nomadTokenID** | **String** | | [optional] -**parameterizedJob** | [**ParameterizedJobConfig**](ParameterizedJobConfig.md) | | [optional] -**parentID** | **String** | | [optional] -**payload** | **byte[]** | | [optional] -**periodic** | [**PeriodicConfig**](PeriodicConfig.md) | | [optional] -**priority** | **Integer** | | [optional] -**region** | **String** | | [optional] -**reschedule** | [**ReschedulePolicy**](ReschedulePolicy.md) | | [optional] -**spreads** | [**List<Spread>**](Spread.md) | | [optional] -**stable** | **Boolean** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**stop** | **Boolean** | | [optional] -**submitTime** | **Long** | | [optional] -**taskGroups** | [**List<TaskGroup>**](TaskGroup.md) | | [optional] -**type** | **String** | | [optional] -**update** | [**UpdateStrategy**](UpdateStrategy.md) | | [optional] -**vaultNamespace** | **String** | | [optional] -**vaultToken** | **String** | | [optional] -**version** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] | +|**allAtOnce** | **Boolean** | | [optional] | +|**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] | +|**consulNamespace** | **String** | | [optional] | +|**consulToken** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**datacenters** | **List<String>** | | [optional] | +|**dispatchIdempotencyToken** | **String** | | [optional] | +|**dispatched** | **Boolean** | | [optional] | +|**ID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**migrate** | [**MigrateStrategy**](MigrateStrategy.md) | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**multiregion** | [**Multiregion**](Multiregion.md) | | [optional] | +|**name** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nomadTokenID** | **String** | | [optional] | +|**parameterizedJob** | [**ParameterizedJobConfig**](ParameterizedJobConfig.md) | | [optional] | +|**parentID** | **String** | | [optional] | +|**payload** | **byte[]** | | [optional] | +|**periodic** | [**PeriodicConfig**](PeriodicConfig.md) | | [optional] | +|**priority** | **Integer** | | [optional] | +|**region** | **String** | | [optional] | +|**reschedule** | [**ReschedulePolicy**](ReschedulePolicy.md) | | [optional] | +|**spreads** | [**List<Spread>**](Spread.md) | | [optional] | +|**stable** | **Boolean** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**stop** | **Boolean** | | [optional] | +|**submitTime** | **Long** | | [optional] | +|**taskGroups** | [**List<TaskGroup>**](TaskGroup.md) | | [optional] | +|**type** | **String** | | [optional] | +|**update** | [**UpdateStrategy**](UpdateStrategy.md) | | [optional] | +|**vaultNamespace** | **String** | | [optional] | +|**vaultToken** | **String** | | [optional] | +|**version** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/JobChildrenSummary.md b/clients/java/v1/docs/JobChildrenSummary.md index 271b79b8..a6481abd 100644 --- a/clients/java/v1/docs/JobChildrenSummary.md +++ b/clients/java/v1/docs/JobChildrenSummary.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dead** | **Long** | | [optional] -**pending** | **Long** | | [optional] -**running** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dead** | **Long** | | [optional] | +|**pending** | **Long** | | [optional] | +|**running** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/JobDeregisterResponse.md b/clients/java/v1/docs/JobDeregisterResponse.md index b30248eb..6063baf2 100644 --- a/clients/java/v1/docs/JobDeregisterResponse.md +++ b/clients/java/v1/docs/JobDeregisterResponse.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalCreateIndex** | **Integer** | | [optional] -**evalID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/JobDiff.md b/clients/java/v1/docs/JobDiff.md index 34ebb668..3b0336b4 100644 --- a/clients/java/v1/docs/JobDiff.md +++ b/clients/java/v1/docs/JobDiff.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] -**ID** | **String** | | [optional] -**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] -**taskGroups** | [**List<TaskGroupDiff>**](TaskGroupDiff.md) | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] | +|**ID** | **String** | | [optional] | +|**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] | +|**taskGroups** | [**List<TaskGroupDiff>**](TaskGroupDiff.md) | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobDispatchRequest.md b/clients/java/v1/docs/JobDispatchRequest.md index 41891bcb..981ab1d0 100644 --- a/clients/java/v1/docs/JobDispatchRequest.md +++ b/clients/java/v1/docs/JobDispatchRequest.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**jobID** | **String** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**payload** | **byte[]** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jobID** | **String** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**payload** | **byte[]** | | [optional] | diff --git a/clients/java/v1/docs/JobDispatchResponse.md b/clients/java/v1/docs/JobDispatchResponse.md index 8d6fa435..d6edc345 100644 --- a/clients/java/v1/docs/JobDispatchResponse.md +++ b/clients/java/v1/docs/JobDispatchResponse.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dispatchedJobID** | **String** | | [optional] -**evalCreateIndex** | **Integer** | | [optional] -**evalID** | **String** | | [optional] -**jobCreateIndex** | **Integer** | | [optional] -**lastIndex** | **Integer** | | [optional] -**requestTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dispatchedJobID** | **String** | | [optional] | +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalID** | **String** | | [optional] | +|**jobCreateIndex** | **Integer** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**requestTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/JobEvaluateRequest.md b/clients/java/v1/docs/JobEvaluateRequest.md index 7dc2ddaa..01d1d0d7 100644 --- a/clients/java/v1/docs/JobEvaluateRequest.md +++ b/clients/java/v1/docs/JobEvaluateRequest.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalOptions** | [**EvalOptions**](EvalOptions.md) | | [optional] -**jobID** | **String** | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalOptions** | [**EvalOptions**](EvalOptions.md) | | [optional] | +|**jobID** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobListStub.md b/clients/java/v1/docs/JobListStub.md index ee2afb77..84c968ec 100644 --- a/clients/java/v1/docs/JobListStub.md +++ b/clients/java/v1/docs/JobListStub.md @@ -5,25 +5,25 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**datacenters** | **List<String>** | | [optional] -**ID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**jobSummary** | [**JobSummary**](JobSummary.md) | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**namespace** | **String** | | [optional] -**parameterizedJob** | **Boolean** | | [optional] -**parentID** | **String** | | [optional] -**periodic** | **Boolean** | | [optional] -**priority** | **Integer** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**stop** | **Boolean** | | [optional] -**submitTime** | **Long** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**datacenters** | **List<String>** | | [optional] | +|**ID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**jobSummary** | [**JobSummary**](JobSummary.md) | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**namespace** | **String** | | [optional] | +|**parameterizedJob** | **Boolean** | | [optional] | +|**parentID** | **String** | | [optional] | +|**periodic** | **Boolean** | | [optional] | +|**priority** | **Integer** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**stop** | **Boolean** | | [optional] | +|**submitTime** | **Long** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobPlanRequest.md b/clients/java/v1/docs/JobPlanRequest.md index 9e52bbb5..875a7513 100644 --- a/clients/java/v1/docs/JobPlanRequest.md +++ b/clients/java/v1/docs/JobPlanRequest.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diff** | **Boolean** | | [optional] -**job** | [**Job**](Job.md) | | [optional] -**namespace** | **String** | | [optional] -**policyOverride** | **Boolean** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diff** | **Boolean** | | [optional] | +|**job** | [**Job**](Job.md) | | [optional] | +|**namespace** | **String** | | [optional] | +|**policyOverride** | **Boolean** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobPlanResponse.md b/clients/java/v1/docs/JobPlanResponse.md index 360db993..25f4de2b 100644 --- a/clients/java/v1/docs/JobPlanResponse.md +++ b/clients/java/v1/docs/JobPlanResponse.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**annotations** | [**PlanAnnotations**](PlanAnnotations.md) | | [optional] -**createdEvals** | [**List<Evaluation>**](Evaluation.md) | | [optional] -**diff** | [**JobDiff**](JobDiff.md) | | [optional] -**failedTGAllocs** | [**Map<String, AllocationMetric>**](AllocationMetric.md) | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**nextPeriodicLaunch** | **OffsetDateTime** | | [optional] -**warnings** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**annotations** | [**PlanAnnotations**](PlanAnnotations.md) | | [optional] | +|**createdEvals** | [**List<Evaluation>**](Evaluation.md) | | [optional] | +|**diff** | [**JobDiff**](JobDiff.md) | | [optional] | +|**failedTGAllocs** | [**Map<String, AllocationMetric>**](AllocationMetric.md) | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**nextPeriodicLaunch** | **OffsetDateTime** | | [optional] | +|**warnings** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobRegisterRequest.md b/clients/java/v1/docs/JobRegisterRequest.md index ca5b878e..aef635bd 100644 --- a/clients/java/v1/docs/JobRegisterRequest.md +++ b/clients/java/v1/docs/JobRegisterRequest.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enforceIndex** | **Boolean** | | [optional] -**evalPriority** | **Integer** | | [optional] -**job** | [**Job**](Job.md) | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**policyOverride** | **Boolean** | | [optional] -**preserveCounts** | **Boolean** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enforceIndex** | **Boolean** | | [optional] | +|**evalPriority** | **Integer** | | [optional] | +|**job** | [**Job**](Job.md) | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**policyOverride** | **Boolean** | | [optional] | +|**preserveCounts** | **Boolean** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobRegisterResponse.md b/clients/java/v1/docs/JobRegisterResponse.md index 3c4ff35a..6bf8bf71 100644 --- a/clients/java/v1/docs/JobRegisterResponse.md +++ b/clients/java/v1/docs/JobRegisterResponse.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalCreateIndex** | **Integer** | | [optional] -**evalID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**warnings** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**warnings** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobRevertRequest.md b/clients/java/v1/docs/JobRevertRequest.md index bcd852bd..b1e97ace 100644 --- a/clients/java/v1/docs/JobRevertRequest.md +++ b/clients/java/v1/docs/JobRevertRequest.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**consulToken** | **String** | | [optional] -**enforcePriorVersion** | **Integer** | | [optional] -**jobID** | **String** | | [optional] -**jobVersion** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**vaultToken** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**consulToken** | **String** | | [optional] | +|**enforcePriorVersion** | **Integer** | | [optional] | +|**jobID** | **String** | | [optional] | +|**jobVersion** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**vaultToken** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobScaleStatusResponse.md b/clients/java/v1/docs/JobScaleStatusResponse.md index 8e9e058e..3d6754f7 100644 --- a/clients/java/v1/docs/JobScaleStatusResponse.md +++ b/clients/java/v1/docs/JobScaleStatusResponse.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**jobCreateIndex** | **Integer** | | [optional] -**jobID** | **String** | | [optional] -**jobModifyIndex** | **Integer** | | [optional] -**jobStopped** | **Boolean** | | [optional] -**namespace** | **String** | | [optional] -**taskGroups** | [**Map<String, TaskGroupScaleStatus>**](TaskGroupScaleStatus.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jobCreateIndex** | **Integer** | | [optional] | +|**jobID** | **String** | | [optional] | +|**jobModifyIndex** | **Integer** | | [optional] | +|**jobStopped** | **Boolean** | | [optional] | +|**namespace** | **String** | | [optional] | +|**taskGroups** | [**Map<String, TaskGroupScaleStatus>**](TaskGroupScaleStatus.md) | | [optional] | diff --git a/clients/java/v1/docs/JobStabilityRequest.md b/clients/java/v1/docs/JobStabilityRequest.md index 0e6afadc..a10b0264 100644 --- a/clients/java/v1/docs/JobStabilityRequest.md +++ b/clients/java/v1/docs/JobStabilityRequest.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**jobID** | **String** | | [optional] -**jobVersion** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**stable** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jobID** | **String** | | [optional] | +|**jobVersion** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**stable** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/JobStabilityResponse.md b/clients/java/v1/docs/JobStabilityResponse.md index 8f231179..9f7afa91 100644 --- a/clients/java/v1/docs/JobStabilityResponse.md +++ b/clients/java/v1/docs/JobStabilityResponse.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**index** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**index** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/JobSummary.md b/clients/java/v1/docs/JobSummary.md index 9d67df62..36e440ab 100644 --- a/clients/java/v1/docs/JobSummary.md +++ b/clients/java/v1/docs/JobSummary.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**children** | [**JobChildrenSummary**](JobChildrenSummary.md) | | [optional] -**createIndex** | **Integer** | | [optional] -**jobID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**summary** | [**Map<String, TaskGroupSummary>**](TaskGroupSummary.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**children** | [**JobChildrenSummary**](JobChildrenSummary.md) | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**jobID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**summary** | [**Map<String, TaskGroupSummary>**](TaskGroupSummary.md) | | [optional] | diff --git a/clients/java/v1/docs/JobValidateRequest.md b/clients/java/v1/docs/JobValidateRequest.md index 66dd79f2..337976b0 100644 --- a/clients/java/v1/docs/JobValidateRequest.md +++ b/clients/java/v1/docs/JobValidateRequest.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**job** | [**Job**](Job.md) | | [optional] -**namespace** | **String** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**job** | [**Job**](Job.md) | | [optional] | +|**namespace** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobValidateResponse.md b/clients/java/v1/docs/JobValidateResponse.md index 79d69e2e..b0865e7a 100644 --- a/clients/java/v1/docs/JobValidateResponse.md +++ b/clients/java/v1/docs/JobValidateResponse.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**driverConfigValidated** | **Boolean** | | [optional] -**error** | **String** | | [optional] -**validationErrors** | **List<String>** | | [optional] -**warnings** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**driverConfigValidated** | **Boolean** | | [optional] | +|**error** | **String** | | [optional] | +|**validationErrors** | **List<String>** | | [optional] | +|**warnings** | **String** | | [optional] | diff --git a/clients/java/v1/docs/JobVersionsResponse.md b/clients/java/v1/docs/JobVersionsResponse.md index dc74a6cf..ccb267da 100644 --- a/clients/java/v1/docs/JobVersionsResponse.md +++ b/clients/java/v1/docs/JobVersionsResponse.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diffs** | [**List<JobDiff>**](JobDiff.md) | | [optional] -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**versions** | [**List<Job>**](Job.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diffs** | [**List<JobDiff>**](JobDiff.md) | | [optional] | +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**versions** | [**List<Job>**](Job.md) | | [optional] | diff --git a/clients/java/v1/docs/JobsApi.md b/clients/java/v1/docs/JobsApi.md index 9cb0774a..ddc85ae1 100644 --- a/clients/java/v1/docs/JobsApi.md +++ b/clients/java/v1/docs/JobsApi.md @@ -2,29 +2,29 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteJob**](JobsApi.md#deleteJob) | **DELETE** /job/{jobName} | -[**getJob**](JobsApi.md#getJob) | **GET** /job/{jobName} | -[**getJobAllocations**](JobsApi.md#getJobAllocations) | **GET** /job/{jobName}/allocations | -[**getJobDeployment**](JobsApi.md#getJobDeployment) | **GET** /job/{jobName}/deployment | -[**getJobDeployments**](JobsApi.md#getJobDeployments) | **GET** /job/{jobName}/deployments | -[**getJobEvaluations**](JobsApi.md#getJobEvaluations) | **GET** /job/{jobName}/evaluations | -[**getJobScaleStatus**](JobsApi.md#getJobScaleStatus) | **GET** /job/{jobName}/scale | -[**getJobSummary**](JobsApi.md#getJobSummary) | **GET** /job/{jobName}/summary | -[**getJobVersions**](JobsApi.md#getJobVersions) | **GET** /job/{jobName}/versions | -[**getJobs**](JobsApi.md#getJobs) | **GET** /jobs | -[**postJob**](JobsApi.md#postJob) | **POST** /job/{jobName} | -[**postJobDispatch**](JobsApi.md#postJobDispatch) | **POST** /job/{jobName}/dispatch | -[**postJobEvaluate**](JobsApi.md#postJobEvaluate) | **POST** /job/{jobName}/evaluate | -[**postJobParse**](JobsApi.md#postJobParse) | **POST** /jobs/parse | -[**postJobPeriodicForce**](JobsApi.md#postJobPeriodicForce) | **POST** /job/{jobName}/periodic/force | -[**postJobPlan**](JobsApi.md#postJobPlan) | **POST** /job/{jobName}/plan | -[**postJobRevert**](JobsApi.md#postJobRevert) | **POST** /job/{jobName}/revert | -[**postJobScalingRequest**](JobsApi.md#postJobScalingRequest) | **POST** /job/{jobName}/scale | -[**postJobStability**](JobsApi.md#postJobStability) | **POST** /job/{jobName}/stable | -[**postJobValidateRequest**](JobsApi.md#postJobValidateRequest) | **POST** /validate/job | -[**registerJob**](JobsApi.md#registerJob) | **POST** /jobs | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteJob**](JobsApi.md#deleteJob) | **DELETE** /job/{jobName} | | +| [**getJob**](JobsApi.md#getJob) | **GET** /job/{jobName} | | +| [**getJobAllocations**](JobsApi.md#getJobAllocations) | **GET** /job/{jobName}/allocations | | +| [**getJobDeployment**](JobsApi.md#getJobDeployment) | **GET** /job/{jobName}/deployment | | +| [**getJobDeployments**](JobsApi.md#getJobDeployments) | **GET** /job/{jobName}/deployments | | +| [**getJobEvaluations**](JobsApi.md#getJobEvaluations) | **GET** /job/{jobName}/evaluations | | +| [**getJobScaleStatus**](JobsApi.md#getJobScaleStatus) | **GET** /job/{jobName}/scale | | +| [**getJobSummary**](JobsApi.md#getJobSummary) | **GET** /job/{jobName}/summary | | +| [**getJobVersions**](JobsApi.md#getJobVersions) | **GET** /job/{jobName}/versions | | +| [**getJobs**](JobsApi.md#getJobs) | **GET** /jobs | | +| [**postJob**](JobsApi.md#postJob) | **POST** /job/{jobName} | | +| [**postJobDispatch**](JobsApi.md#postJobDispatch) | **POST** /job/{jobName}/dispatch | | +| [**postJobEvaluate**](JobsApi.md#postJobEvaluate) | **POST** /job/{jobName}/evaluate | | +| [**postJobParse**](JobsApi.md#postJobParse) | **POST** /jobs/parse | | +| [**postJobPeriodicForce**](JobsApi.md#postJobPeriodicForce) | **POST** /job/{jobName}/periodic/force | | +| [**postJobPlan**](JobsApi.md#postJobPlan) | **POST** /job/{jobName}/plan | | +| [**postJobRevert**](JobsApi.md#postJobRevert) | **POST** /job/{jobName}/revert | | +| [**postJobScalingRequest**](JobsApi.md#postJobScalingRequest) | **POST** /job/{jobName}/scale | | +| [**postJobStability**](JobsApi.md#postJobStability) | **POST** /job/{jobName}/stable | | +| [**postJobValidateRequest**](JobsApi.md#postJobValidateRequest) | **POST** /validate/job | | +| [**registerJob**](JobsApi.md#registerJob) | **POST** /jobs | | @@ -78,15 +78,15 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] - **purge** | **Boolean**| Boolean flag indicating whether to purge allocations of the job after deleting. | [optional] - **global** | **Boolean**| Boolean flag indicating whether the operation should apply to all instances of the job globally. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | +| **purge** | **Boolean**| Boolean flag indicating whether to purge allocations of the job after deleting. | [optional] | +| **global** | **Boolean**| Boolean flag indicating whether the operation should apply to all instances of the job globally. | [optional] | ### Return type @@ -104,11 +104,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJob** @@ -164,18 +164,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -193,11 +193,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobAllocations** @@ -254,19 +254,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **all** | **Boolean**| Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **all** | **Boolean**| Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered. | [optional] | ### Return type @@ -284,11 +284,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobDeployment** @@ -344,18 +344,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -373,11 +373,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobDeployments** @@ -434,19 +434,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **all** | **Integer**| Flag indicating whether to constrain by job creation index or not. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **all** | **Integer**| Flag indicating whether to constrain by job creation index or not. | [optional] | ### Return type @@ -464,11 +464,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobEvaluations** @@ -524,18 +524,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -553,11 +553,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobScaleStatus** @@ -613,18 +613,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -642,11 +642,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobSummary** @@ -702,18 +702,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -731,11 +731,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobVersions** @@ -792,19 +792,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **diffs** | **Boolean**| Boolean flag indicating whether to compute job diffs. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **diffs** | **Boolean**| Boolean flag indicating whether to compute job diffs. | [optional] | ### Return type @@ -822,11 +822,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getJobs** @@ -881,17 +881,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -909,11 +909,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJob** @@ -965,14 +965,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **jobRegisterRequest** | [**JobRegisterRequest**](JobRegisterRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **jobRegisterRequest** | [**JobRegisterRequest**](JobRegisterRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -990,11 +990,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobDispatch** @@ -1046,14 +1046,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **jobDispatchRequest** | [**JobDispatchRequest**](JobDispatchRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **jobDispatchRequest** | [**JobDispatchRequest**](JobDispatchRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1071,11 +1071,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobEvaluate** @@ -1127,14 +1127,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **jobEvaluateRequest** | [**JobEvaluateRequest**](JobEvaluateRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **jobEvaluateRequest** | [**JobEvaluateRequest**](JobEvaluateRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1152,11 +1152,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobParse** @@ -1203,9 +1203,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobsParseRequest** | [**JobsParseRequest**](JobsParseRequest.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobsParseRequest** | [**JobsParseRequest**](JobsParseRequest.md)| | | ### Return type @@ -1223,11 +1223,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobPeriodicForce** @@ -1278,13 +1278,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1302,11 +1302,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobPlan** @@ -1358,14 +1358,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **jobPlanRequest** | [**JobPlanRequest**](JobPlanRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **jobPlanRequest** | [**JobPlanRequest**](JobPlanRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1383,11 +1383,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobRevert** @@ -1439,14 +1439,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **jobRevertRequest** | [**JobRevertRequest**](JobRevertRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **jobRevertRequest** | [**JobRevertRequest**](JobRevertRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1464,11 +1464,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobScalingRequest** @@ -1520,14 +1520,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **scalingRequest** | [**ScalingRequest**](ScalingRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **scalingRequest** | [**ScalingRequest**](ScalingRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1545,11 +1545,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobStability** @@ -1601,14 +1601,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobName** | **String**| The job identifier. | - **jobStabilityRequest** | [**JobStabilityRequest**](JobStabilityRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobName** | **String**| The job identifier. | | +| **jobStabilityRequest** | [**JobStabilityRequest**](JobStabilityRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1626,11 +1626,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postJobValidateRequest** @@ -1681,13 +1681,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobValidateRequest** | [**JobValidateRequest**](JobValidateRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobValidateRequest** | [**JobValidateRequest**](JobValidateRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1705,11 +1705,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **registerJob** @@ -1760,13 +1760,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobRegisterRequest** | [**JobRegisterRequest**](JobRegisterRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **jobRegisterRequest** | [**JobRegisterRequest**](JobRegisterRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -1784,9 +1784,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/JobsParseRequest.md b/clients/java/v1/docs/JobsParseRequest.md index 8d1b0fcb..c7e8cecc 100644 --- a/clients/java/v1/docs/JobsParseRequest.md +++ b/clients/java/v1/docs/JobsParseRequest.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**canonicalize** | **Boolean** | | [optional] -**jobHCL** | **String** | | [optional] -**hclv1** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**canonicalize** | **Boolean** | | [optional] | +|**jobHCL** | **String** | | [optional] | +|**hclv1** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/LogConfig.md b/clients/java/v1/docs/LogConfig.md index 0cf5805d..3e0e2ea3 100644 --- a/clients/java/v1/docs/LogConfig.md +++ b/clients/java/v1/docs/LogConfig.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**maxFileSizeMB** | **Integer** | | [optional] -**maxFiles** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maxFileSizeMB** | **Integer** | | [optional] | +|**maxFiles** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/MetricsApi.md b/clients/java/v1/docs/MetricsApi.md index 7ad0d300..c64c1278 100644 --- a/clients/java/v1/docs/MetricsApi.md +++ b/clients/java/v1/docs/MetricsApi.md @@ -2,9 +2,9 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getMetricsSummary**](MetricsApi.md#getMetricsSummary) | **GET** /metrics | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getMetricsSummary**](MetricsApi.md#getMetricsSummary) | **GET** /metrics | | @@ -52,9 +52,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **format** | **String**| The format the user requested for the metrics summary (e.g. prometheus) | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **format** | **String**| The format the user requested for the metrics summary (e.g. prometheus) | [optional] | ### Return type @@ -72,9 +72,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/MetricsSummary.md b/clients/java/v1/docs/MetricsSummary.md index 9db385c5..196ac5f2 100644 --- a/clients/java/v1/docs/MetricsSummary.md +++ b/clients/java/v1/docs/MetricsSummary.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**counters** | [**List<SampledValue>**](SampledValue.md) | | [optional] -**gauges** | [**List<GaugeValue>**](GaugeValue.md) | | [optional] -**points** | [**List<PointValue>**](PointValue.md) | | [optional] -**samples** | [**List<SampledValue>**](SampledValue.md) | | [optional] -**timestamp** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**counters** | [**List<SampledValue>**](SampledValue.md) | | [optional] | +|**gauges** | [**List<GaugeValue>**](GaugeValue.md) | | [optional] | +|**points** | [**List<PointValue>**](PointValue.md) | | [optional] | +|**samples** | [**List<SampledValue>**](SampledValue.md) | | [optional] | +|**timestamp** | **String** | | [optional] | diff --git a/clients/java/v1/docs/MigrateStrategy.md b/clients/java/v1/docs/MigrateStrategy.md index 7806eadf..50f72cfd 100644 --- a/clients/java/v1/docs/MigrateStrategy.md +++ b/clients/java/v1/docs/MigrateStrategy.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**healthCheck** | **String** | | [optional] -**healthyDeadline** | **Long** | | [optional] -**maxParallel** | **Integer** | | [optional] -**minHealthyTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**healthCheck** | **String** | | [optional] | +|**healthyDeadline** | **Long** | | [optional] | +|**maxParallel** | **Integer** | | [optional] | +|**minHealthyTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/Multiregion.md b/clients/java/v1/docs/Multiregion.md index ad748699..e6198ae4 100644 --- a/clients/java/v1/docs/Multiregion.md +++ b/clients/java/v1/docs/Multiregion.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**regions** | [**List<MultiregionRegion>**](MultiregionRegion.md) | | [optional] -**strategy** | [**MultiregionStrategy**](MultiregionStrategy.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**regions** | [**List<MultiregionRegion>**](MultiregionRegion.md) | | [optional] | +|**strategy** | [**MultiregionStrategy**](MultiregionStrategy.md) | | [optional] | diff --git a/clients/java/v1/docs/MultiregionRegion.md b/clients/java/v1/docs/MultiregionRegion.md index 028fec4d..e45cd60e 100644 --- a/clients/java/v1/docs/MultiregionRegion.md +++ b/clients/java/v1/docs/MultiregionRegion.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Integer** | | [optional] -**datacenters** | **List<String>** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**name** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**count** | **Integer** | | [optional] | +|**datacenters** | **List<String>** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**name** | **String** | | [optional] | diff --git a/clients/java/v1/docs/MultiregionStrategy.md b/clients/java/v1/docs/MultiregionStrategy.md index b135cf5d..41c12b60 100644 --- a/clients/java/v1/docs/MultiregionStrategy.md +++ b/clients/java/v1/docs/MultiregionStrategy.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**maxParallel** | **Integer** | | [optional] -**onFailure** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maxParallel** | **Integer** | | [optional] | +|**onFailure** | **String** | | [optional] | diff --git a/clients/java/v1/docs/Namespace.md b/clients/java/v1/docs/Namespace.md index 8ed052a2..fb31c41e 100644 --- a/clients/java/v1/docs/Namespace.md +++ b/clients/java/v1/docs/Namespace.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capabilities** | [**NamespaceCapabilities**](NamespaceCapabilities.md) | | [optional] -**createIndex** | **Integer** | | [optional] -**description** | **String** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**quota** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capabilities** | [**NamespaceCapabilities**](NamespaceCapabilities.md) | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**description** | **String** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**quota** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NamespaceCapabilities.md b/clients/java/v1/docs/NamespaceCapabilities.md index ffbb3e98..442f3a56 100644 --- a/clients/java/v1/docs/NamespaceCapabilities.md +++ b/clients/java/v1/docs/NamespaceCapabilities.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disabledTaskDrivers** | **List<String>** | | [optional] -**enabledTaskDrivers** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**disabledTaskDrivers** | **List<String>** | | [optional] | +|**enabledTaskDrivers** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/NamespacesApi.md b/clients/java/v1/docs/NamespacesApi.md index 8efc3a26..c175b30b 100644 --- a/clients/java/v1/docs/NamespacesApi.md +++ b/clients/java/v1/docs/NamespacesApi.md @@ -2,13 +2,13 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createNamespace**](NamespacesApi.md#createNamespace) | **POST** /namespace | -[**deleteNamespace**](NamespacesApi.md#deleteNamespace) | **DELETE** /namespace/{namespaceName} | -[**getNamespace**](NamespacesApi.md#getNamespace) | **GET** /namespace/{namespaceName} | -[**getNamespaces**](NamespacesApi.md#getNamespaces) | **GET** /namespaces | -[**postNamespace**](NamespacesApi.md#postNamespace) | **POST** /namespace/{namespaceName} | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createNamespace**](NamespacesApi.md#createNamespace) | **POST** /namespace | | +| [**deleteNamespace**](NamespacesApi.md#deleteNamespace) | **DELETE** /namespace/{namespaceName} | | +| [**getNamespace**](NamespacesApi.md#getNamespace) | **GET** /namespace/{namespaceName} | | +| [**getNamespaces**](NamespacesApi.md#getNamespaces) | **GET** /namespaces | | +| [**postNamespace**](NamespacesApi.md#postNamespace) | **POST** /namespace/{namespaceName} | | @@ -58,12 +58,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -81,11 +81,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **deleteNamespace** @@ -135,13 +135,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **namespaceName** | **String**| The namespace identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **namespaceName** | **String**| The namespace identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -159,11 +159,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getNamespace** @@ -219,18 +219,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **namespaceName** | **String**| The namespace identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **namespaceName** | **String**| The namespace identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -248,11 +248,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getNamespaces** @@ -307,17 +307,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -335,11 +335,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postNamespace** @@ -390,14 +390,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **namespaceName** | **String**| The namespace identifier. | - **namespace2** | [**Namespace**](Namespace.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **namespaceName** | **String**| The namespace identifier. | | +| **namespace2** | [**Namespace**](Namespace.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -415,9 +415,9 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/NetworkResource.md b/clients/java/v1/docs/NetworkResource.md index 813f3d57..0f5c7226 100644 --- a/clients/java/v1/docs/NetworkResource.md +++ b/clients/java/v1/docs/NetworkResource.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CIDR** | **String** | | [optional] -**DNS** | [**DNSConfig**](DNSConfig.md) | | [optional] -**device** | **String** | | [optional] -**dynamicPorts** | [**List<Port>**](Port.md) | | [optional] -**hostname** | **String** | | [optional] -**IP** | **String** | | [optional] -**mbits** | **Integer** | | [optional] -**mode** | **String** | | [optional] -**reservedPorts** | [**List<Port>**](Port.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**CIDR** | **String** | | [optional] | +|**DNS** | [**DNSConfig**](DNSConfig.md) | | [optional] | +|**device** | **String** | | [optional] | +|**dynamicPorts** | [**List<Port>**](Port.md) | | [optional] | +|**hostname** | **String** | | [optional] | +|**IP** | **String** | | [optional] | +|**mbits** | **Integer** | | [optional] | +|**mode** | **String** | | [optional] | +|**reservedPorts** | [**List<Port>**](Port.md) | | [optional] | diff --git a/clients/java/v1/docs/Node.md b/clients/java/v1/docs/Node.md index 23196973..1928cd8e 100644 --- a/clients/java/v1/docs/Node.md +++ b/clients/java/v1/docs/Node.md @@ -5,37 +5,37 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | **Map<String, String>** | | [optional] -**csIControllerPlugins** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] -**csINodePlugins** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] -**cgroupParent** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**datacenter** | **String** | | [optional] -**drain** | **Boolean** | | [optional] -**drainStrategy** | [**DrainStrategy**](DrainStrategy.md) | | [optional] -**drivers** | [**Map<String, DriverInfo>**](DriverInfo.md) | | [optional] -**events** | [**List<NodeEvent>**](NodeEvent.md) | | [optional] -**htTPAddr** | **String** | | [optional] -**hostNetworks** | [**Map<String, HostNetworkInfo>**](HostNetworkInfo.md) | | [optional] -**hostVolumes** | [**Map<String, HostVolumeInfo>**](HostVolumeInfo.md) | | [optional] -**ID** | **String** | | [optional] -**lastDrain** | [**DrainMetadata**](DrainMetadata.md) | | [optional] -**links** | **Map<String, String>** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**nodeClass** | **String** | | [optional] -**nodeResources** | [**NodeResources**](NodeResources.md) | | [optional] -**reserved** | [**Resources**](Resources.md) | | [optional] -**reservedResources** | [**NodeReservedResources**](NodeReservedResources.md) | | [optional] -**resources** | [**Resources**](Resources.md) | | [optional] -**schedulingEligibility** | **String** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**statusUpdatedAt** | **Long** | | [optional] -**tlSEnabled** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**attributes** | **Map<String, String>** | | [optional] | +|**csIControllerPlugins** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] | +|**csINodePlugins** | [**Map<String, CSIInfo>**](CSIInfo.md) | | [optional] | +|**cgroupParent** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**datacenter** | **String** | | [optional] | +|**drain** | **Boolean** | | [optional] | +|**drainStrategy** | [**DrainStrategy**](DrainStrategy.md) | | [optional] | +|**drivers** | [**Map<String, DriverInfo>**](DriverInfo.md) | | [optional] | +|**events** | [**List<NodeEvent>**](NodeEvent.md) | | [optional] | +|**htTPAddr** | **String** | | [optional] | +|**hostNetworks** | [**Map<String, HostNetworkInfo>**](HostNetworkInfo.md) | | [optional] | +|**hostVolumes** | [**Map<String, HostVolumeInfo>**](HostVolumeInfo.md) | | [optional] | +|**ID** | **String** | | [optional] | +|**lastDrain** | [**DrainMetadata**](DrainMetadata.md) | | [optional] | +|**links** | **Map<String, String>** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**nodeClass** | **String** | | [optional] | +|**nodeResources** | [**NodeResources**](NodeResources.md) | | [optional] | +|**reserved** | [**Resources**](Resources.md) | | [optional] | +|**reservedResources** | [**NodeReservedResources**](NodeReservedResources.md) | | [optional] | +|**resources** | [**Resources**](Resources.md) | | [optional] | +|**schedulingEligibility** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**statusUpdatedAt** | **Long** | | [optional] | +|**tlSEnabled** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/NodeCpuResources.md b/clients/java/v1/docs/NodeCpuResources.md index 76eef6e0..583ed31b 100644 --- a/clients/java/v1/docs/NodeCpuResources.md +++ b/clients/java/v1/docs/NodeCpuResources.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cpuShares** | **Long** | | [optional] -**reservableCpuCores** | **List<Integer>** | | [optional] -**totalCpuCores** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cpuShares** | **Long** | | [optional] | +|**reservableCpuCores** | **List<Integer>** | | [optional] | +|**totalCpuCores** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/NodeDevice.md b/clients/java/v1/docs/NodeDevice.md index 9bd49df6..f5ca3468 100644 --- a/clients/java/v1/docs/NodeDevice.md +++ b/clients/java/v1/docs/NodeDevice.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**healthDescription** | **String** | | [optional] -**healthy** | **Boolean** | | [optional] -**ID** | **String** | | [optional] -**locality** | [**NodeDeviceLocality**](NodeDeviceLocality.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**healthDescription** | **String** | | [optional] | +|**healthy** | **Boolean** | | [optional] | +|**ID** | **String** | | [optional] | +|**locality** | [**NodeDeviceLocality**](NodeDeviceLocality.md) | | [optional] | diff --git a/clients/java/v1/docs/NodeDeviceLocality.md b/clients/java/v1/docs/NodeDeviceLocality.md index 28c5620b..4368e045 100644 --- a/clients/java/v1/docs/NodeDeviceLocality.md +++ b/clients/java/v1/docs/NodeDeviceLocality.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pciBusID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pciBusID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NodeDeviceResource.md b/clients/java/v1/docs/NodeDeviceResource.md index 9c424493..cc341cf3 100644 --- a/clients/java/v1/docs/NodeDeviceResource.md +++ b/clients/java/v1/docs/NodeDeviceResource.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | [**Map<String, Attribute>**](Attribute.md) | | [optional] -**instances** | [**List<NodeDevice>**](NodeDevice.md) | | [optional] -**name** | **String** | | [optional] -**type** | **String** | | [optional] -**vendor** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**attributes** | [**Map<String, Attribute>**](Attribute.md) | | [optional] | +|**instances** | [**List<NodeDevice>**](NodeDevice.md) | | [optional] | +|**name** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**vendor** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NodeDiskResources.md b/clients/java/v1/docs/NodeDiskResources.md index bff097a9..fc384c81 100644 --- a/clients/java/v1/docs/NodeDiskResources.md +++ b/clients/java/v1/docs/NodeDiskResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diskMB** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diskMB** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/NodeDrainUpdateResponse.md b/clients/java/v1/docs/NodeDrainUpdateResponse.md index 051d4587..110cb741 100644 --- a/clients/java/v1/docs/NodeDrainUpdateResponse.md +++ b/clients/java/v1/docs/NodeDrainUpdateResponse.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalCreateIndex** | **Integer** | | [optional] -**evalIDs** | **List<String>** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nodeModifyIndex** | **Integer** | | [optional] -**requestTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalIDs** | **List<String>** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nodeModifyIndex** | **Integer** | | [optional] | +|**requestTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/NodeEligibilityUpdateResponse.md b/clients/java/v1/docs/NodeEligibilityUpdateResponse.md index f365f28d..df011f8c 100644 --- a/clients/java/v1/docs/NodeEligibilityUpdateResponse.md +++ b/clients/java/v1/docs/NodeEligibilityUpdateResponse.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalCreateIndex** | **Integer** | | [optional] -**evalIDs** | **List<String>** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nodeModifyIndex** | **Integer** | | [optional] -**requestTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalIDs** | **List<String>** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nodeModifyIndex** | **Integer** | | [optional] | +|**requestTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/NodeEvent.md b/clients/java/v1/docs/NodeEvent.md index 0adaf259..25e772cd 100644 --- a/clients/java/v1/docs/NodeEvent.md +++ b/clients/java/v1/docs/NodeEvent.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**details** | **Map<String, String>** | | [optional] -**message** | **String** | | [optional] -**subsystem** | **String** | | [optional] -**timestamp** | **OffsetDateTime** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**details** | **Map<String, String>** | | [optional] | +|**message** | **String** | | [optional] | +|**subsystem** | **String** | | [optional] | +|**timestamp** | **OffsetDateTime** | | [optional] | diff --git a/clients/java/v1/docs/NodeListStub.md b/clients/java/v1/docs/NodeListStub.md index b707b437..9b9f25a0 100644 --- a/clients/java/v1/docs/NodeListStub.md +++ b/clients/java/v1/docs/NodeListStub.md @@ -5,25 +5,25 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address** | **String** | | [optional] -**attributes** | **Map<String, String>** | | [optional] -**createIndex** | **Integer** | | [optional] -**datacenter** | **String** | | [optional] -**drain** | **Boolean** | | [optional] -**drivers** | [**Map<String, DriverInfo>**](DriverInfo.md) | | [optional] -**ID** | **String** | | [optional] -**lastDrain** | [**DrainMetadata**](DrainMetadata.md) | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] -**nodeClass** | **String** | | [optional] -**nodeResources** | [**NodeResources**](NodeResources.md) | | [optional] -**reservedResources** | [**NodeReservedResources**](NodeReservedResources.md) | | [optional] -**schedulingEligibility** | **String** | | [optional] -**status** | **String** | | [optional] -**statusDescription** | **String** | | [optional] -**version** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**address** | **String** | | [optional] | +|**attributes** | **Map<String, String>** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**datacenter** | **String** | | [optional] | +|**drain** | **Boolean** | | [optional] | +|**drivers** | [**Map<String, DriverInfo>**](DriverInfo.md) | | [optional] | +|**ID** | **String** | | [optional] | +|**lastDrain** | [**DrainMetadata**](DrainMetadata.md) | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**nodeClass** | **String** | | [optional] | +|**nodeResources** | [**NodeResources**](NodeResources.md) | | [optional] | +|**reservedResources** | [**NodeReservedResources**](NodeReservedResources.md) | | [optional] | +|**schedulingEligibility** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**statusDescription** | **String** | | [optional] | +|**version** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NodeMemoryResources.md b/clients/java/v1/docs/NodeMemoryResources.md index 97eaeedd..e5a23faf 100644 --- a/clients/java/v1/docs/NodeMemoryResources.md +++ b/clients/java/v1/docs/NodeMemoryResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**memoryMB** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**memoryMB** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/NodePurgeResponse.md b/clients/java/v1/docs/NodePurgeResponse.md index 45ea9a9c..90edbccf 100644 --- a/clients/java/v1/docs/NodePurgeResponse.md +++ b/clients/java/v1/docs/NodePurgeResponse.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalCreateIndex** | **Integer** | | [optional] -**evalIDs** | **List<String>** | | [optional] -**nodeModifyIndex** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalIDs** | **List<String>** | | [optional] | +|**nodeModifyIndex** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/NodeReservedCpuResources.md b/clients/java/v1/docs/NodeReservedCpuResources.md index 1229f91f..545f2b66 100644 --- a/clients/java/v1/docs/NodeReservedCpuResources.md +++ b/clients/java/v1/docs/NodeReservedCpuResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cpuShares** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cpuShares** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/NodeReservedDiskResources.md b/clients/java/v1/docs/NodeReservedDiskResources.md index c6c4e341..1e8cfc6f 100644 --- a/clients/java/v1/docs/NodeReservedDiskResources.md +++ b/clients/java/v1/docs/NodeReservedDiskResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diskMB** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diskMB** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/NodeReservedMemoryResources.md b/clients/java/v1/docs/NodeReservedMemoryResources.md index 72f56333..522ec131 100644 --- a/clients/java/v1/docs/NodeReservedMemoryResources.md +++ b/clients/java/v1/docs/NodeReservedMemoryResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**memoryMB** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**memoryMB** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/NodeReservedNetworkResources.md b/clients/java/v1/docs/NodeReservedNetworkResources.md index 7974c29f..c6fb8c2e 100644 --- a/clients/java/v1/docs/NodeReservedNetworkResources.md +++ b/clients/java/v1/docs/NodeReservedNetworkResources.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reservedHostPorts** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**reservedHostPorts** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NodeReservedResources.md b/clients/java/v1/docs/NodeReservedResources.md index 4e0bcc1d..61856ed2 100644 --- a/clients/java/v1/docs/NodeReservedResources.md +++ b/clients/java/v1/docs/NodeReservedResources.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cpu** | [**NodeReservedCpuResources**](NodeReservedCpuResources.md) | | [optional] -**disk** | [**NodeReservedDiskResources**](NodeReservedDiskResources.md) | | [optional] -**memory** | [**NodeReservedMemoryResources**](NodeReservedMemoryResources.md) | | [optional] -**networks** | [**NodeReservedNetworkResources**](NodeReservedNetworkResources.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cpu** | [**NodeReservedCpuResources**](NodeReservedCpuResources.md) | | [optional] | +|**disk** | [**NodeReservedDiskResources**](NodeReservedDiskResources.md) | | [optional] | +|**memory** | [**NodeReservedMemoryResources**](NodeReservedMemoryResources.md) | | [optional] | +|**networks** | [**NodeReservedNetworkResources**](NodeReservedNetworkResources.md) | | [optional] | diff --git a/clients/java/v1/docs/NodeResources.md b/clients/java/v1/docs/NodeResources.md index f94c500c..1312b6c6 100644 --- a/clients/java/v1/docs/NodeResources.md +++ b/clients/java/v1/docs/NodeResources.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cpu** | [**NodeCpuResources**](NodeCpuResources.md) | | [optional] -**devices** | [**List<NodeDeviceResource>**](NodeDeviceResource.md) | | [optional] -**disk** | [**NodeDiskResources**](NodeDiskResources.md) | | [optional] -**maxDynamicPort** | **Integer** | | [optional] -**memory** | [**NodeMemoryResources**](NodeMemoryResources.md) | | [optional] -**minDynamicPort** | **Integer** | | [optional] -**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cpu** | [**NodeCpuResources**](NodeCpuResources.md) | | [optional] | +|**devices** | [**List<NodeDeviceResource>**](NodeDeviceResource.md) | | [optional] | +|**disk** | [**NodeDiskResources**](NodeDiskResources.md) | | [optional] | +|**maxDynamicPort** | **Integer** | | [optional] | +|**memory** | [**NodeMemoryResources**](NodeMemoryResources.md) | | [optional] | +|**minDynamicPort** | **Integer** | | [optional] | +|**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] | diff --git a/clients/java/v1/docs/NodeScoreMeta.md b/clients/java/v1/docs/NodeScoreMeta.md index 856fdedb..20a88ff0 100644 --- a/clients/java/v1/docs/NodeScoreMeta.md +++ b/clients/java/v1/docs/NodeScoreMeta.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nodeID** | **String** | | [optional] -**normScore** | **Double** | | [optional] -**scores** | **Map<String, Double>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nodeID** | **String** | | [optional] | +|**normScore** | **Double** | | [optional] | +|**scores** | **Map<String, Double>** | | [optional] | diff --git a/clients/java/v1/docs/NodeUpdateDrainRequest.md b/clients/java/v1/docs/NodeUpdateDrainRequest.md index e143cf07..f61e7f93 100644 --- a/clients/java/v1/docs/NodeUpdateDrainRequest.md +++ b/clients/java/v1/docs/NodeUpdateDrainRequest.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**drainSpec** | [**DrainSpec**](DrainSpec.md) | | [optional] -**markEligible** | **Boolean** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**nodeID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**drainSpec** | [**DrainSpec**](DrainSpec.md) | | [optional] | +|**markEligible** | **Boolean** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**nodeID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NodeUpdateEligibilityRequest.md b/clients/java/v1/docs/NodeUpdateEligibilityRequest.md index 528c5aea..5aa177f5 100644 --- a/clients/java/v1/docs/NodeUpdateEligibilityRequest.md +++ b/clients/java/v1/docs/NodeUpdateEligibilityRequest.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**eligibility** | **String** | | [optional] -**nodeID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eligibility** | **String** | | [optional] | +|**nodeID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/NodesApi.md b/clients/java/v1/docs/NodesApi.md index ce092a6b..658fa763 100644 --- a/clients/java/v1/docs/NodesApi.md +++ b/clients/java/v1/docs/NodesApi.md @@ -2,14 +2,14 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getNode**](NodesApi.md#getNode) | **GET** /node/{nodeId} | -[**getNodeAllocations**](NodesApi.md#getNodeAllocations) | **GET** /node/{nodeId}/allocations | -[**getNodes**](NodesApi.md#getNodes) | **GET** /nodes | -[**updateNodeDrain**](NodesApi.md#updateNodeDrain) | **POST** /node/{nodeId}/drain | -[**updateNodeEligibility**](NodesApi.md#updateNodeEligibility) | **POST** /node/{nodeId}/eligibility | -[**updateNodePurge**](NodesApi.md#updateNodePurge) | **POST** /node/{nodeId}/purge | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getNode**](NodesApi.md#getNode) | **GET** /node/{nodeId} | | +| [**getNodeAllocations**](NodesApi.md#getNodeAllocations) | **GET** /node/{nodeId}/allocations | | +| [**getNodes**](NodesApi.md#getNodes) | **GET** /nodes | | +| [**updateNodeDrain**](NodesApi.md#updateNodeDrain) | **POST** /node/{nodeId}/drain | | +| [**updateNodeEligibility**](NodesApi.md#updateNodeEligibility) | **POST** /node/{nodeId}/eligibility | | +| [**updateNodePurge**](NodesApi.md#updateNodePurge) | **POST** /node/{nodeId}/purge | | @@ -66,18 +66,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **nodeId** | **String**| The ID of the node. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nodeId** | **String**| The ID of the node. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -95,11 +95,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getNodeAllocations** @@ -155,18 +155,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **nodeId** | **String**| The ID of the node. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nodeId** | **String**| The ID of the node. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -184,11 +184,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getNodes** @@ -244,18 +244,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **resources** | **Boolean**| Whether or not to include the NodeResources and ReservedResources fields in the response. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **resources** | **Boolean**| Whether or not to include the NodeResources and ReservedResources fields in the response. | [optional] | ### Return type @@ -273,11 +273,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **updateNodeDrain** @@ -334,19 +334,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **nodeId** | **String**| The ID of the node. | - **nodeUpdateDrainRequest** | [**NodeUpdateDrainRequest**](NodeUpdateDrainRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nodeId** | **String**| The ID of the node. | | +| **nodeUpdateDrainRequest** | [**NodeUpdateDrainRequest**](NodeUpdateDrainRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -364,11 +364,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **updateNodeEligibility** @@ -425,19 +425,19 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **nodeId** | **String**| The ID of the node. | - **nodeUpdateEligibilityRequest** | [**NodeUpdateEligibilityRequest**](NodeUpdateEligibilityRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nodeId** | **String**| The ID of the node. | | +| **nodeUpdateEligibilityRequest** | [**NodeUpdateEligibilityRequest**](NodeUpdateEligibilityRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -455,11 +455,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **updateNodePurge** @@ -515,18 +515,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **nodeId** | **String**| The ID of the node. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nodeId** | **String**| The ID of the node. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -544,9 +544,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/ObjectDiff.md b/clients/java/v1/docs/ObjectDiff.md index 55f32527..20a4e84b 100644 --- a/clients/java/v1/docs/ObjectDiff.md +++ b/clients/java/v1/docs/ObjectDiff.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] -**name** | **String** | | [optional] -**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] | +|**name** | **String** | | [optional] | +|**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/OneTimeToken.md b/clients/java/v1/docs/OneTimeToken.md index 81de3896..8019ae5a 100644 --- a/clients/java/v1/docs/OneTimeToken.md +++ b/clients/java/v1/docs/OneTimeToken.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessorID** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**expiresAt** | **OffsetDateTime** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**oneTimeSecretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessorID** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**expiresAt** | **OffsetDateTime** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**oneTimeSecretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/OneTimeTokenExchangeRequest.md b/clients/java/v1/docs/OneTimeTokenExchangeRequest.md index 5e3a38ed..4085abe0 100644 --- a/clients/java/v1/docs/OneTimeTokenExchangeRequest.md +++ b/clients/java/v1/docs/OneTimeTokenExchangeRequest.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**oneTimeSecretID** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**oneTimeSecretID** | **String** | | [optional] | diff --git a/clients/java/v1/docs/OperatorApi.md b/clients/java/v1/docs/OperatorApi.md index 7bd0b1f6..2c90d55a 100644 --- a/clients/java/v1/docs/OperatorApi.md +++ b/clients/java/v1/docs/OperatorApi.md @@ -2,15 +2,15 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOperatorRaftPeer**](OperatorApi.md#deleteOperatorRaftPeer) | **DELETE** /operator/raft/peer | -[**getOperatorAutopilotConfiguration**](OperatorApi.md#getOperatorAutopilotConfiguration) | **GET** /operator/autopilot/configuration | -[**getOperatorAutopilotHealth**](OperatorApi.md#getOperatorAutopilotHealth) | **GET** /operator/autopilot/health | -[**getOperatorRaftConfiguration**](OperatorApi.md#getOperatorRaftConfiguration) | **GET** /operator/raft/configuration | -[**getOperatorSchedulerConfiguration**](OperatorApi.md#getOperatorSchedulerConfiguration) | **GET** /operator/scheduler/configuration | -[**postOperatorSchedulerConfiguration**](OperatorApi.md#postOperatorSchedulerConfiguration) | **POST** /operator/scheduler/configuration | -[**putOperatorAutopilotConfiguration**](OperatorApi.md#putOperatorAutopilotConfiguration) | **PUT** /operator/autopilot/configuration | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOperatorRaftPeer**](OperatorApi.md#deleteOperatorRaftPeer) | **DELETE** /operator/raft/peer | | +| [**getOperatorAutopilotConfiguration**](OperatorApi.md#getOperatorAutopilotConfiguration) | **GET** /operator/autopilot/configuration | | +| [**getOperatorAutopilotHealth**](OperatorApi.md#getOperatorAutopilotHealth) | **GET** /operator/autopilot/health | | +| [**getOperatorRaftConfiguration**](OperatorApi.md#getOperatorRaftConfiguration) | **GET** /operator/raft/configuration | | +| [**getOperatorSchedulerConfiguration**](OperatorApi.md#getOperatorSchedulerConfiguration) | **GET** /operator/scheduler/configuration | | +| [**postOperatorSchedulerConfiguration**](OperatorApi.md#postOperatorSchedulerConfiguration) | **POST** /operator/scheduler/configuration | | +| [**putOperatorAutopilotConfiguration**](OperatorApi.md#putOperatorAutopilotConfiguration) | **PUT** /operator/autopilot/configuration | | @@ -60,12 +60,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -83,11 +83,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getOperatorAutopilotConfiguration** @@ -142,17 +142,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -170,11 +170,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getOperatorAutopilotHealth** @@ -229,17 +229,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -257,11 +257,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getOperatorRaftConfiguration** @@ -316,17 +316,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -344,11 +344,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getOperatorSchedulerConfiguration** @@ -403,17 +403,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -431,11 +431,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postOperatorSchedulerConfiguration** @@ -486,13 +486,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **schedulerConfiguration** | [**SchedulerConfiguration**](SchedulerConfiguration.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schedulerConfiguration** | [**SchedulerConfiguration**](SchedulerConfiguration.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -510,11 +510,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **putOperatorAutopilotConfiguration** @@ -565,13 +565,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **autopilotConfiguration** | [**AutopilotConfiguration**](AutopilotConfiguration.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **autopilotConfiguration** | [**AutopilotConfiguration**](AutopilotConfiguration.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -589,9 +589,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/OperatorHealthReply.md b/clients/java/v1/docs/OperatorHealthReply.md index 6a5a0e22..a877cf33 100644 --- a/clients/java/v1/docs/OperatorHealthReply.md +++ b/clients/java/v1/docs/OperatorHealthReply.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**failureTolerance** | **Integer** | | [optional] -**healthy** | **Boolean** | | [optional] -**servers** | [**List<ServerHealth>**](ServerHealth.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**failureTolerance** | **Integer** | | [optional] | +|**healthy** | **Boolean** | | [optional] | +|**servers** | [**List<ServerHealth>**](ServerHealth.md) | | [optional] | diff --git a/clients/java/v1/docs/ParameterizedJobConfig.md b/clients/java/v1/docs/ParameterizedJobConfig.md index 1abfc83b..ce6e4a38 100644 --- a/clients/java/v1/docs/ParameterizedJobConfig.md +++ b/clients/java/v1/docs/ParameterizedJobConfig.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metaOptional** | **List<String>** | | [optional] -**metaRequired** | **List<String>** | | [optional] -**payload** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**metaOptional** | **List<String>** | | [optional] | +|**metaRequired** | **List<String>** | | [optional] | +|**payload** | **String** | | [optional] | diff --git a/clients/java/v1/docs/PeriodicConfig.md b/clients/java/v1/docs/PeriodicConfig.md index 2cba1488..9a56c1e9 100644 --- a/clients/java/v1/docs/PeriodicConfig.md +++ b/clients/java/v1/docs/PeriodicConfig.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enabled** | **Boolean** | | [optional] -**prohibitOverlap** | **Boolean** | | [optional] -**spec** | **String** | | [optional] -**specType** | **String** | | [optional] -**timeZone** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enabled** | **Boolean** | | [optional] | +|**prohibitOverlap** | **Boolean** | | [optional] | +|**spec** | **String** | | [optional] | +|**specType** | **String** | | [optional] | +|**timeZone** | **String** | | [optional] | diff --git a/clients/java/v1/docs/PeriodicForceResponse.md b/clients/java/v1/docs/PeriodicForceResponse.md index 704169f2..f7e03771 100644 --- a/clients/java/v1/docs/PeriodicForceResponse.md +++ b/clients/java/v1/docs/PeriodicForceResponse.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evalCreateIndex** | **Integer** | | [optional] -**evalID** | **String** | | [optional] -**index** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evalCreateIndex** | **Integer** | | [optional] | +|**evalID** | **String** | | [optional] | +|**index** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/PlanAnnotations.md b/clients/java/v1/docs/PlanAnnotations.md index 07266bb5..812b5c2a 100644 --- a/clients/java/v1/docs/PlanAnnotations.md +++ b/clients/java/v1/docs/PlanAnnotations.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**desiredTGUpdates** | [**Map<String, DesiredUpdates>**](DesiredUpdates.md) | | [optional] -**preemptedAllocs** | [**List<AllocationListStub>**](AllocationListStub.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**desiredTGUpdates** | [**Map<String, DesiredUpdates>**](DesiredUpdates.md) | | [optional] | +|**preemptedAllocs** | [**List<AllocationListStub>**](AllocationListStub.md) | | [optional] | diff --git a/clients/java/v1/docs/PluginsApi.md b/clients/java/v1/docs/PluginsApi.md index 850337f0..6d8b15a2 100644 --- a/clients/java/v1/docs/PluginsApi.md +++ b/clients/java/v1/docs/PluginsApi.md @@ -2,10 +2,10 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getPluginCSI**](PluginsApi.md#getPluginCSI) | **GET** /plugin/csi/{pluginID} | -[**getPlugins**](PluginsApi.md#getPlugins) | **GET** /plugins | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getPluginCSI**](PluginsApi.md#getPluginCSI) | **GET** /plugin/csi/{pluginID} | | +| [**getPlugins**](PluginsApi.md#getPlugins) | **GET** /plugins | | @@ -62,18 +62,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pluginID** | **String**| The CSI plugin identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pluginID** | **String**| The CSI plugin identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -91,11 +91,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getPlugins** @@ -150,17 +150,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -178,9 +178,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/PointValue.md b/clients/java/v1/docs/PointValue.md index 7768bc1a..bac98982 100644 --- a/clients/java/v1/docs/PointValue.md +++ b/clients/java/v1/docs/PointValue.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] -**points** | **List<Float>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**points** | **List<Float>** | | [optional] | diff --git a/clients/java/v1/docs/Port.md b/clients/java/v1/docs/Port.md index 95a7e785..be40fe94 100644 --- a/clients/java/v1/docs/Port.md +++ b/clients/java/v1/docs/Port.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hostNetwork** | **String** | | [optional] -**label** | **String** | | [optional] -**to** | **Integer** | | [optional] -**value** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hostNetwork** | **String** | | [optional] | +|**label** | **String** | | [optional] | +|**to** | **Integer** | | [optional] | +|**value** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/PortMapping.md b/clients/java/v1/docs/PortMapping.md index bd29c83e..5915cdd7 100644 --- a/clients/java/v1/docs/PortMapping.md +++ b/clients/java/v1/docs/PortMapping.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hostIP** | **String** | | [optional] -**label** | **String** | | [optional] -**to** | **Integer** | | [optional] -**value** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hostIP** | **String** | | [optional] | +|**label** | **String** | | [optional] | +|**to** | **Integer** | | [optional] | +|**value** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/PreemptionConfig.md b/clients/java/v1/docs/PreemptionConfig.md index 56196449..5501769b 100644 --- a/clients/java/v1/docs/PreemptionConfig.md +++ b/clients/java/v1/docs/PreemptionConfig.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**batchSchedulerEnabled** | **Boolean** | | [optional] -**serviceSchedulerEnabled** | **Boolean** | | [optional] -**sysBatchSchedulerEnabled** | **Boolean** | | [optional] -**systemSchedulerEnabled** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**batchSchedulerEnabled** | **Boolean** | | [optional] | +|**serviceSchedulerEnabled** | **Boolean** | | [optional] | +|**sysBatchSchedulerEnabled** | **Boolean** | | [optional] | +|**systemSchedulerEnabled** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/QuotaLimit.md b/clients/java/v1/docs/QuotaLimit.md index 34929b8d..a9d7507a 100644 --- a/clients/java/v1/docs/QuotaLimit.md +++ b/clients/java/v1/docs/QuotaLimit.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hash** | **byte[]** | | [optional] -**region** | **String** | | [optional] -**regionLimit** | [**Resources**](Resources.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hash** | **byte[]** | | [optional] | +|**region** | **String** | | [optional] | +|**regionLimit** | [**Resources**](Resources.md) | | [optional] | diff --git a/clients/java/v1/docs/QuotaSpec.md b/clients/java/v1/docs/QuotaSpec.md index eeae92d1..75daea8e 100644 --- a/clients/java/v1/docs/QuotaSpec.md +++ b/clients/java/v1/docs/QuotaSpec.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**description** | **String** | | [optional] -**limits** | [**List<QuotaLimit>**](QuotaLimit.md) | | [optional] -**modifyIndex** | **Integer** | | [optional] -**name** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**description** | **String** | | [optional] | +|**limits** | [**List<QuotaLimit>**](QuotaLimit.md) | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | diff --git a/clients/java/v1/docs/RaftConfiguration.md b/clients/java/v1/docs/RaftConfiguration.md index 24382f2d..5e5dabe2 100644 --- a/clients/java/v1/docs/RaftConfiguration.md +++ b/clients/java/v1/docs/RaftConfiguration.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**index** | **Integer** | | [optional] -**servers** | [**List<RaftServer>**](RaftServer.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**index** | **Integer** | | [optional] | +|**servers** | [**List<RaftServer>**](RaftServer.md) | | [optional] | diff --git a/clients/java/v1/docs/RaftServer.md b/clients/java/v1/docs/RaftServer.md index 90eef460..b5198147 100644 --- a/clients/java/v1/docs/RaftServer.md +++ b/clients/java/v1/docs/RaftServer.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address** | **String** | | [optional] -**ID** | **String** | | [optional] -**leader** | **Boolean** | | [optional] -**node** | **String** | | [optional] -**raftProtocol** | **String** | | [optional] -**voter** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**address** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**leader** | **Boolean** | | [optional] | +|**node** | **String** | | [optional] | +|**raftProtocol** | **String** | | [optional] | +|**voter** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/RegionsApi.md b/clients/java/v1/docs/RegionsApi.md index b797eb2d..ad46ced3 100644 --- a/clients/java/v1/docs/RegionsApi.md +++ b/clients/java/v1/docs/RegionsApi.md @@ -2,9 +2,9 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getRegions**](RegionsApi.md#getRegions) | **GET** /regions | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getRegions**](RegionsApi.md#getRegions) | **GET** /regions | | @@ -68,9 +68,9 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/RequestedDevice.md b/clients/java/v1/docs/RequestedDevice.md index d4149939..e3865363 100644 --- a/clients/java/v1/docs/RequestedDevice.md +++ b/clients/java/v1/docs/RequestedDevice.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] -**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] -**count** | **Integer** | | [optional] -**name** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] | +|**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] | +|**count** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | diff --git a/clients/java/v1/docs/RescheduleEvent.md b/clients/java/v1/docs/RescheduleEvent.md index ee9fb1bb..69a32961 100644 --- a/clients/java/v1/docs/RescheduleEvent.md +++ b/clients/java/v1/docs/RescheduleEvent.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**prevAllocID** | **String** | | [optional] -**prevNodeID** | **String** | | [optional] -**rescheduleTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**prevAllocID** | **String** | | [optional] | +|**prevNodeID** | **String** | | [optional] | +|**rescheduleTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/ReschedulePolicy.md b/clients/java/v1/docs/ReschedulePolicy.md index 4c9aa67b..35db69ce 100644 --- a/clients/java/v1/docs/ReschedulePolicy.md +++ b/clients/java/v1/docs/ReschedulePolicy.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attempts** | **Integer** | | [optional] -**delay** | **Long** | | [optional] -**delayFunction** | **String** | | [optional] -**interval** | **Long** | | [optional] -**maxDelay** | **Long** | | [optional] -**unlimited** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**attempts** | **Integer** | | [optional] | +|**delay** | **Long** | | [optional] | +|**delayFunction** | **String** | | [optional] | +|**interval** | **Long** | | [optional] | +|**maxDelay** | **Long** | | [optional] | +|**unlimited** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/RescheduleTracker.md b/clients/java/v1/docs/RescheduleTracker.md index d32a168f..a135e069 100644 --- a/clients/java/v1/docs/RescheduleTracker.md +++ b/clients/java/v1/docs/RescheduleTracker.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**List<RescheduleEvent>**](RescheduleEvent.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**events** | [**List<RescheduleEvent>**](RescheduleEvent.md) | | [optional] | diff --git a/clients/java/v1/docs/Resources.md b/clients/java/v1/docs/Resources.md index 8a9a13c6..172d2525 100644 --- a/clients/java/v1/docs/Resources.md +++ b/clients/java/v1/docs/Resources.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CPU** | **Integer** | | [optional] -**cores** | **Integer** | | [optional] -**devices** | [**List<RequestedDevice>**](RequestedDevice.md) | | [optional] -**diskMB** | **Integer** | | [optional] -**IOPS** | **Integer** | | [optional] -**memoryMB** | **Integer** | | [optional] -**memoryMaxMB** | **Integer** | | [optional] -**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**CPU** | **Integer** | | [optional] | +|**cores** | **Integer** | | [optional] | +|**devices** | [**List<RequestedDevice>**](RequestedDevice.md) | | [optional] | +|**diskMB** | **Integer** | | [optional] | +|**IOPS** | **Integer** | | [optional] | +|**memoryMB** | **Integer** | | [optional] | +|**memoryMaxMB** | **Integer** | | [optional] | +|**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] | diff --git a/clients/java/v1/docs/RestartPolicy.md b/clients/java/v1/docs/RestartPolicy.md index 61ff7769..6feef190 100644 --- a/clients/java/v1/docs/RestartPolicy.md +++ b/clients/java/v1/docs/RestartPolicy.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attempts** | **Integer** | | [optional] -**delay** | **Long** | | [optional] -**interval** | **Long** | | [optional] -**mode** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**attempts** | **Integer** | | [optional] | +|**delay** | **Long** | | [optional] | +|**interval** | **Long** | | [optional] | +|**mode** | **String** | | [optional] | diff --git a/clients/java/v1/docs/SampledValue.md b/clients/java/v1/docs/SampledValue.md index 2c9de794..b23d0a43 100644 --- a/clients/java/v1/docs/SampledValue.md +++ b/clients/java/v1/docs/SampledValue.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Integer** | | [optional] -**labels** | **Map<String, String>** | | [optional] -**max** | **Double** | | [optional] -**mean** | **Double** | | [optional] -**min** | **Double** | | [optional] -**name** | **String** | | [optional] -**rate** | **Double** | | [optional] -**stddev** | **Double** | | [optional] -**sum** | **Double** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**count** | **Integer** | | [optional] | +|**labels** | **Map<String, String>** | | [optional] | +|**max** | **Double** | | [optional] | +|**mean** | **Double** | | [optional] | +|**min** | **Double** | | [optional] | +|**name** | **String** | | [optional] | +|**rate** | **Double** | | [optional] | +|**stddev** | **Double** | | [optional] | +|**sum** | **Double** | | [optional] | diff --git a/clients/java/v1/docs/ScalingApi.md b/clients/java/v1/docs/ScalingApi.md index 29244e1d..bdd9a94f 100644 --- a/clients/java/v1/docs/ScalingApi.md +++ b/clients/java/v1/docs/ScalingApi.md @@ -2,10 +2,10 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getScalingPolicies**](ScalingApi.md#getScalingPolicies) | **GET** /scaling/policies | -[**getScalingPolicy**](ScalingApi.md#getScalingPolicy) | **GET** /scaling/policy/{policyID} | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getScalingPolicies**](ScalingApi.md#getScalingPolicies) | **GET** /scaling/policies | | +| [**getScalingPolicy**](ScalingApi.md#getScalingPolicy) | **GET** /scaling/policy/{policyID} | | @@ -61,17 +61,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -89,11 +89,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getScalingPolicy** @@ -149,18 +149,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyID** | **String**| The scaling policy identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyID** | **String**| The scaling policy identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -178,9 +178,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/ScalingEvent.md b/clients/java/v1/docs/ScalingEvent.md index 93868d72..9a39b3b8 100644 --- a/clients/java/v1/docs/ScalingEvent.md +++ b/clients/java/v1/docs/ScalingEvent.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Long** | | [optional] -**createIndex** | **Integer** | | [optional] -**error** | **Boolean** | | [optional] -**evalID** | **String** | | [optional] -**message** | **String** | | [optional] -**meta** | **Map<String, Object>** | | [optional] -**previousCount** | **Long** | | [optional] -**time** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**count** | **Long** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**error** | **Boolean** | | [optional] | +|**evalID** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**meta** | **Map<String, Object>** | | [optional] | +|**previousCount** | **Long** | | [optional] | +|**time** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/ScalingPolicy.md b/clients/java/v1/docs/ScalingPolicy.md index 0f5c70bc..ff7e5aa5 100644 --- a/clients/java/v1/docs/ScalingPolicy.md +++ b/clients/java/v1/docs/ScalingPolicy.md @@ -5,18 +5,18 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**enabled** | **Boolean** | | [optional] -**ID** | **String** | | [optional] -**max** | **Long** | | [optional] -**min** | **Long** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**policy** | **Map<String, Object>** | | [optional] -**target** | **Map<String, String>** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**enabled** | **Boolean** | | [optional] | +|**ID** | **String** | | [optional] | +|**max** | **Long** | | [optional] | +|**min** | **Long** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**policy** | **Map<String, Object>** | | [optional] | +|**target** | **Map<String, String>** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ScalingPolicyListStub.md b/clients/java/v1/docs/ScalingPolicyListStub.md index bd4d8c10..35533fef 100644 --- a/clients/java/v1/docs/ScalingPolicyListStub.md +++ b/clients/java/v1/docs/ScalingPolicyListStub.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**enabled** | **Boolean** | | [optional] -**ID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**target** | **Map<String, String>** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createIndex** | **Integer** | | [optional] | +|**enabled** | **Boolean** | | [optional] | +|**ID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**target** | **Map<String, String>** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ScalingRequest.md b/clients/java/v1/docs/ScalingRequest.md index d1285e14..3aa3a93a 100644 --- a/clients/java/v1/docs/ScalingRequest.md +++ b/clients/java/v1/docs/ScalingRequest.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Long** | | [optional] -**error** | **Boolean** | | [optional] -**message** | **String** | | [optional] -**meta** | **Map<String, Object>** | | [optional] -**namespace** | **String** | | [optional] -**policyOverride** | **Boolean** | | [optional] -**region** | **String** | | [optional] -**secretID** | **String** | | [optional] -**target** | **Map<String, String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**count** | **Long** | | [optional] | +|**error** | **Boolean** | | [optional] | +|**message** | **String** | | [optional] | +|**meta** | **Map<String, Object>** | | [optional] | +|**namespace** | **String** | | [optional] | +|**policyOverride** | **Boolean** | | [optional] | +|**region** | **String** | | [optional] | +|**secretID** | **String** | | [optional] | +|**target** | **Map<String, String>** | | [optional] | diff --git a/clients/java/v1/docs/SchedulerConfiguration.md b/clients/java/v1/docs/SchedulerConfiguration.md index 91748c3d..f50d142a 100644 --- a/clients/java/v1/docs/SchedulerConfiguration.md +++ b/clients/java/v1/docs/SchedulerConfiguration.md @@ -5,15 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createIndex** | **Integer** | | [optional] -**memoryOversubscriptionEnabled** | **Boolean** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**pauseEvalBroker** | **Boolean** | | [optional] -**preemptionConfig** | [**PreemptionConfig**](PreemptionConfig.md) | | [optional] -**rejectJobRegistration** | **Boolean** | | [optional] -**schedulerAlgorithm** | **String** | | [optional] - - - +| Name | Type | Description | Notes | +| --------------------------------- | ------------------------------------------- | ----------- | ---------- | +| **createIndex** | **Integer** | | [optional] | +| **memoryOversubscriptionEnabled** | **Boolean** | | [optional] | +| **modifyIndex** | **Integer** | | [optional] | +| **pauseEvalBroker** | **Boolean** | | [optional] | +| **preemptionConfig** | [**PreemptionConfig**](PreemptionConfig.md) | | [optional] | +| **rejectJobRegistration** | **Boolean** | | [optional] | +| **schedulerAlgorithm** | **String** | | [optional] | diff --git a/clients/java/v1/docs/SchedulerConfigurationResponse.md b/clients/java/v1/docs/SchedulerConfigurationResponse.md index 920cf05d..a68c43c0 100644 --- a/clients/java/v1/docs/SchedulerConfigurationResponse.md +++ b/clients/java/v1/docs/SchedulerConfigurationResponse.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**schedulerConfig** | [**SchedulerConfiguration**](SchedulerConfiguration.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**schedulerConfig** | [**SchedulerConfiguration**](SchedulerConfiguration.md) | | [optional] | diff --git a/clients/java/v1/docs/SchedulerSetConfigurationResponse.md b/clients/java/v1/docs/SchedulerSetConfigurationResponse.md index a0a349a9..eb51fd4c 100644 --- a/clients/java/v1/docs/SchedulerSetConfigurationResponse.md +++ b/clients/java/v1/docs/SchedulerSetConfigurationResponse.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lastIndex** | **Integer** | | [optional] -**requestTime** | **Long** | | [optional] -**updated** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lastIndex** | **Integer** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**updated** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/SearchApi.md b/clients/java/v1/docs/SearchApi.md index c48c4e0d..7fdfc4d0 100644 --- a/clients/java/v1/docs/SearchApi.md +++ b/clients/java/v1/docs/SearchApi.md @@ -2,10 +2,10 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getFuzzySearch**](SearchApi.md#getFuzzySearch) | **POST** /search/fuzzy | -[**getSearch**](SearchApi.md#getSearch) | **POST** /search | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getFuzzySearch**](SearchApi.md#getFuzzySearch) | **POST** /search/fuzzy | | +| [**getSearch**](SearchApi.md#getSearch) | **POST** /search | | @@ -62,18 +62,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fuzzySearchRequest** | [**FuzzySearchRequest**](FuzzySearchRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fuzzySearchRequest** | [**FuzzySearchRequest**](FuzzySearchRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -91,11 +91,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getSearch** @@ -151,18 +151,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **searchRequest** | [**SearchRequest**](SearchRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **searchRequest** | [**SearchRequest**](SearchRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -180,9 +180,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/SearchRequest.md b/clients/java/v1/docs/SearchRequest.md index 06ec4880..d3737aaa 100644 --- a/clients/java/v1/docs/SearchRequest.md +++ b/clients/java/v1/docs/SearchRequest.md @@ -5,22 +5,22 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allowStale** | **Boolean** | | [optional] -**authToken** | **String** | | [optional] -**context** | **String** | | [optional] -**filter** | **String** | | [optional] -**headers** | **Map<String, String>** | | [optional] -**namespace** | **String** | | [optional] -**nextToken** | **String** | | [optional] -**params** | **Map<String, String>** | | [optional] -**perPage** | **Integer** | | [optional] -**prefix** | **String** | | [optional] -**region** | **String** | | [optional] -**reverse** | **Boolean** | | [optional] -**waitIndex** | **Integer** | | [optional] -**waitTime** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**allowStale** | **Boolean** | | [optional] | +|**authToken** | **String** | | [optional] | +|**context** | **String** | | [optional] | +|**filter** | **String** | | [optional] | +|**headers** | **Map<String, String>** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**params** | **Map<String, String>** | | [optional] | +|**perPage** | **Integer** | | [optional] | +|**prefix** | **String** | | [optional] | +|**region** | **String** | | [optional] | +|**reverse** | **Boolean** | | [optional] | +|**waitIndex** | **Integer** | | [optional] | +|**waitTime** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/SearchResponse.md b/clients/java/v1/docs/SearchResponse.md index 3cc1bb37..e06bc9e1 100644 --- a/clients/java/v1/docs/SearchResponse.md +++ b/clients/java/v1/docs/SearchResponse.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**knownLeader** | **Boolean** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**matches** | **Map<String, List<String>>** | | [optional] -**nextToken** | **String** | | [optional] -**requestTime** | **Long** | | [optional] -**truncations** | **Map<String, Boolean>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**knownLeader** | **Boolean** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**matches** | **Map<String, List<String>>** | | [optional] | +|**nextToken** | **String** | | [optional] | +|**requestTime** | **Long** | | [optional] | +|**truncations** | **Map<String, Boolean>** | | [optional] | diff --git a/clients/java/v1/docs/ServerHealth.md b/clients/java/v1/docs/ServerHealth.md index 4ffb0f97..3924988d 100644 --- a/clients/java/v1/docs/ServerHealth.md +++ b/clients/java/v1/docs/ServerHealth.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address** | **String** | | [optional] -**healthy** | **Boolean** | | [optional] -**ID** | **String** | | [optional] -**lastContact** | **Long** | | [optional] -**lastIndex** | **Integer** | | [optional] -**lastTerm** | **Integer** | | [optional] -**leader** | **Boolean** | | [optional] -**name** | **String** | | [optional] -**serfStatus** | **String** | | [optional] -**stableSince** | **OffsetDateTime** | | [optional] -**version** | **String** | | [optional] -**voter** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**address** | **String** | | [optional] | +|**healthy** | **Boolean** | | [optional] | +|**ID** | **String** | | [optional] | +|**lastContact** | **Long** | | [optional] | +|**lastIndex** | **Integer** | | [optional] | +|**lastTerm** | **Integer** | | [optional] | +|**leader** | **Boolean** | | [optional] | +|**name** | **String** | | [optional] | +|**serfStatus** | **String** | | [optional] | +|**stableSince** | **OffsetDateTime** | | [optional] | +|**version** | **String** | | [optional] | +|**voter** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/Service.md b/clients/java/v1/docs/Service.md index 4a68070e..733d5055 100644 --- a/clients/java/v1/docs/Service.md +++ b/clients/java/v1/docs/Service.md @@ -5,24 +5,21 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address** | **String** | | [optional] -**addressMode** | **String** | | [optional] -**canaryMeta** | **Map<String, String>** | | [optional] -**canaryTags** | **List<String>** | | [optional] -**checkRestart** | [**CheckRestart**](CheckRestart.md) | | [optional] -**checks** | [**List<ServiceCheck>**](ServiceCheck.md) | | [optional] -**connect** | [**ConsulConnect**](ConsulConnect.md) | | [optional] -**enableTagOverride** | **Boolean** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**name** | **String** | | [optional] -**onUpdate** | **String** | | [optional] -**portLabel** | **String** | | [optional] -**provider** | **String** | | [optional] -**taggedAddresses** | **Map<String, String>** | | [optional] -**tags** | **List<String>** | | [optional] -**taskName** | **String** | | [optional] - - - +| Name | Type | Description | Notes | +| --------------------- | ----------------------------------------------- | ----------- | ---------- | +| **address** | **String** | | [optional] | +| **addressMode** | **String** | | [optional] | +| **canaryMeta** | **Map<String, String>** | | [optional] | +| **canaryTags** | **List<String>** | | [optional] | +| **checkRestart** | [**CheckRestart**](CheckRestart.md) | | [optional] | +| **checks** | [**List<ServiceCheck>**](ServiceCheck.md) | | [optional] | +| **connect** | [**ConsulConnect**](ConsulConnect.md) | | [optional] | +| **enableTagOverride** | **Boolean** | | [optional] | +| **meta** | **Map<String, String>** | | [optional] | +| **name** | **String** | | [optional] | +| **onUpdate** | **String** | | [optional] | +| **portLabel** | **String** | | [optional] | +| **provider** | **String** | | [optional] | +| **taggedAddresses** | **Map<String, String>** | | [optional] | +| **tags** | **List<String>** | | [optional] | +| **taskName** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ServiceCheck.md b/clients/java/v1/docs/ServiceCheck.md index d1f02adf..43e9f3a6 100644 --- a/clients/java/v1/docs/ServiceCheck.md +++ b/clients/java/v1/docs/ServiceCheck.md @@ -5,32 +5,32 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addressMode** | **String** | | [optional] -**advertise** | **String** | | [optional] -**args** | **List<String>** | | [optional] -**body** | **String** | | [optional] -**checkRestart** | [**CheckRestart**](CheckRestart.md) | | [optional] -**command** | **String** | | [optional] -**expose** | **Boolean** | | [optional] -**failuresBeforeCritical** | **Integer** | | [optional] -**grPCService** | **String** | | [optional] -**grPCUseTLS** | **Boolean** | | [optional] -**header** | **Map<String, List<String>>** | | [optional] -**initialStatus** | **String** | | [optional] -**interval** | **Long** | | [optional] -**method** | **String** | | [optional] -**name** | **String** | | [optional] -**onUpdate** | **String** | | [optional] -**path** | **String** | | [optional] -**portLabel** | **String** | | [optional] -**protocol** | **String** | | [optional] -**successBeforePassing** | **Integer** | | [optional] -**tlSSkipVerify** | **Boolean** | | [optional] -**taskName** | **String** | | [optional] -**timeout** | **Long** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addressMode** | **String** | | [optional] | +|**advertise** | **String** | | [optional] | +|**args** | **List<String>** | | [optional] | +|**body** | **String** | | [optional] | +|**checkRestart** | [**CheckRestart**](CheckRestart.md) | | [optional] | +|**command** | **String** | | [optional] | +|**expose** | **Boolean** | | [optional] | +|**failuresBeforeCritical** | **Integer** | | [optional] | +|**grPCService** | **String** | | [optional] | +|**grPCUseTLS** | **Boolean** | | [optional] | +|**header** | **Map<String, List<String>>** | | [optional] | +|**initialStatus** | **String** | | [optional] | +|**interval** | **Long** | | [optional] | +|**method** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**onUpdate** | **String** | | [optional] | +|**path** | **String** | | [optional] | +|**portLabel** | **String** | | [optional] | +|**protocol** | **String** | | [optional] | +|**successBeforePassing** | **Integer** | | [optional] | +|**tlSSkipVerify** | **Boolean** | | [optional] | +|**taskName** | **String** | | [optional] | +|**timeout** | **Long** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/ServiceRegistration.md b/clients/java/v1/docs/ServiceRegistration.md index ab7a46e4..fe3b85dc 100644 --- a/clients/java/v1/docs/ServiceRegistration.md +++ b/clients/java/v1/docs/ServiceRegistration.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address** | **String** | | [optional] -**allocID** | **String** | | [optional] -**createIndex** | **Integer** | | [optional] -**datacenter** | **String** | | [optional] -**ID** | **String** | | [optional] -**jobID** | **String** | | [optional] -**modifyIndex** | **Integer** | | [optional] -**namespace** | **String** | | [optional] -**nodeID** | **String** | | [optional] -**port** | **Integer** | | [optional] -**serviceName** | **String** | | [optional] -**tags** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**address** | **String** | | [optional] | +|**allocID** | **String** | | [optional] | +|**createIndex** | **Integer** | | [optional] | +|**datacenter** | **String** | | [optional] | +|**ID** | **String** | | [optional] | +|**jobID** | **String** | | [optional] | +|**modifyIndex** | **Integer** | | [optional] | +|**namespace** | **String** | | [optional] | +|**nodeID** | **String** | | [optional] | +|**port** | **Integer** | | [optional] | +|**serviceName** | **String** | | [optional] | +|**tags** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/SidecarTask.md b/clients/java/v1/docs/SidecarTask.md index a181d775..d6ab3ee0 100644 --- a/clients/java/v1/docs/SidecarTask.md +++ b/clients/java/v1/docs/SidecarTask.md @@ -5,19 +5,19 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**config** | **Map<String, Object>** | | [optional] -**driver** | **String** | | [optional] -**env** | **Map<String, String>** | | [optional] -**killSignal** | **String** | | [optional] -**killTimeout** | **Long** | | [optional] -**logConfig** | [**LogConfig**](LogConfig.md) | | [optional] -**meta** | **Map<String, String>** | | [optional] -**name** | **String** | | [optional] -**resources** | [**Resources**](Resources.md) | | [optional] -**shutdownDelay** | **Long** | | [optional] -**user** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**config** | **Map<String, Object>** | | [optional] | +|**driver** | **String** | | [optional] | +|**env** | **Map<String, String>** | | [optional] | +|**killSignal** | **String** | | [optional] | +|**killTimeout** | **Long** | | [optional] | +|**logConfig** | [**LogConfig**](LogConfig.md) | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**name** | **String** | | [optional] | +|**resources** | [**Resources**](Resources.md) | | [optional] | +|**shutdownDelay** | **Long** | | [optional] | +|**user** | **String** | | [optional] | diff --git a/clients/java/v1/docs/Spread.md b/clients/java/v1/docs/Spread.md index 7ce2c32a..a445f2ba 100644 --- a/clients/java/v1/docs/Spread.md +++ b/clients/java/v1/docs/Spread.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute** | **String** | | [optional] -**spreadTarget** | [**List<SpreadTarget>**](SpreadTarget.md) | | [optional] -**weight** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**attribute** | **String** | | [optional] | +|**spreadTarget** | [**List<SpreadTarget>**](SpreadTarget.md) | | [optional] | +|**weight** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/SpreadTarget.md b/clients/java/v1/docs/SpreadTarget.md index 9c990b63..17aed250 100644 --- a/clients/java/v1/docs/SpreadTarget.md +++ b/clients/java/v1/docs/SpreadTarget.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**percent** | **Integer** | | [optional] -**value** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percent** | **Integer** | | [optional] | +|**value** | **String** | | [optional] | diff --git a/clients/java/v1/docs/StatusApi.md b/clients/java/v1/docs/StatusApi.md index 58731e63..2b4a0337 100644 --- a/clients/java/v1/docs/StatusApi.md +++ b/clients/java/v1/docs/StatusApi.md @@ -2,10 +2,10 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getStatusLeader**](StatusApi.md#getStatusLeader) | **GET** /status/leader | -[**getStatusPeers**](StatusApi.md#getStatusPeers) | **GET** /status/peers | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getStatusLeader**](StatusApi.md#getStatusLeader) | **GET** /status/leader | | +| [**getStatusPeers**](StatusApi.md#getStatusPeers) | **GET** /status/peers | | @@ -61,17 +61,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -89,11 +89,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getStatusPeers** @@ -148,17 +148,17 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -176,9 +176,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/SystemApi.md b/clients/java/v1/docs/SystemApi.md index cad4fbac..4d6cdbaf 100644 --- a/clients/java/v1/docs/SystemApi.md +++ b/clients/java/v1/docs/SystemApi.md @@ -2,10 +2,10 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**putSystemGC**](SystemApi.md#putSystemGC) | **PUT** /system/gc | -[**putSystemReconcileSummaries**](SystemApi.md#putSystemReconcileSummaries) | **PUT** /system/reconcile/summaries | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**putSystemGC**](SystemApi.md#putSystemGC) | **PUT** /system/gc | | +| [**putSystemReconcileSummaries**](SystemApi.md#putSystemReconcileSummaries) | **PUT** /system/reconcile/summaries | | @@ -55,12 +55,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -78,11 +78,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **putSystemReconcileSummaries** @@ -131,12 +131,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -154,9 +154,9 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | - | +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/Task.md b/clients/java/v1/docs/Task.md index 9f0ced60..8c357808 100644 --- a/clients/java/v1/docs/Task.md +++ b/clients/java/v1/docs/Task.md @@ -5,33 +5,33 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] -**artifacts** | [**List<TaskArtifact>**](TaskArtifact.md) | | [optional] -**csIPluginConfig** | [**TaskCSIPluginConfig**](TaskCSIPluginConfig.md) | | [optional] -**config** | **Map<String, Object>** | | [optional] -**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] -**dispatchPayload** | [**DispatchPayloadConfig**](DispatchPayloadConfig.md) | | [optional] -**driver** | **String** | | [optional] -**env** | **Map<String, String>** | | [optional] -**killSignal** | **String** | | [optional] -**killTimeout** | **Long** | | [optional] -**kind** | **String** | | [optional] -**leader** | **Boolean** | | [optional] -**lifecycle** | [**TaskLifecycle**](TaskLifecycle.md) | | [optional] -**logConfig** | [**LogConfig**](LogConfig.md) | | [optional] -**meta** | **Map<String, String>** | | [optional] -**name** | **String** | | [optional] -**resources** | [**Resources**](Resources.md) | | [optional] -**restartPolicy** | [**RestartPolicy**](RestartPolicy.md) | | [optional] -**scalingPolicies** | [**List<ScalingPolicy>**](ScalingPolicy.md) | | [optional] -**services** | [**List<Service>**](Service.md) | | [optional] -**shutdownDelay** | **Long** | | [optional] -**templates** | [**List<Template>**](Template.md) | | [optional] -**user** | **String** | | [optional] -**vault** | [**Vault**](Vault.md) | | [optional] -**volumeMounts** | [**List<VolumeMount>**](VolumeMount.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] | +|**artifacts** | [**List<TaskArtifact>**](TaskArtifact.md) | | [optional] | +|**csIPluginConfig** | [**TaskCSIPluginConfig**](TaskCSIPluginConfig.md) | | [optional] | +|**config** | **Map<String, Object>** | | [optional] | +|**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] | +|**dispatchPayload** | [**DispatchPayloadConfig**](DispatchPayloadConfig.md) | | [optional] | +|**driver** | **String** | | [optional] | +|**env** | **Map<String, String>** | | [optional] | +|**killSignal** | **String** | | [optional] | +|**killTimeout** | **Long** | | [optional] | +|**kind** | **String** | | [optional] | +|**leader** | **Boolean** | | [optional] | +|**lifecycle** | [**TaskLifecycle**](TaskLifecycle.md) | | [optional] | +|**logConfig** | [**LogConfig**](LogConfig.md) | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**name** | **String** | | [optional] | +|**resources** | [**Resources**](Resources.md) | | [optional] | +|**restartPolicy** | [**RestartPolicy**](RestartPolicy.md) | | [optional] | +|**scalingPolicies** | [**List<ScalingPolicy>**](ScalingPolicy.md) | | [optional] | +|**services** | [**List<Service>**](Service.md) | | [optional] | +|**shutdownDelay** | **Long** | | [optional] | +|**templates** | [**List<Template>**](Template.md) | | [optional] | +|**user** | **String** | | [optional] | +|**vault** | [**Vault**](Vault.md) | | [optional] | +|**volumeMounts** | [**List<VolumeMount>**](VolumeMount.md) | | [optional] | diff --git a/clients/java/v1/docs/TaskArtifact.md b/clients/java/v1/docs/TaskArtifact.md index a0be2073..a956db00 100644 --- a/clients/java/v1/docs/TaskArtifact.md +++ b/clients/java/v1/docs/TaskArtifact.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**getterHeaders** | **Map<String, String>** | | [optional] -**getterMode** | **String** | | [optional] -**getterOptions** | **Map<String, String>** | | [optional] -**getterSource** | **String** | | [optional] -**relativeDest** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**getterHeaders** | **Map<String, String>** | | [optional] | +|**getterMode** | **String** | | [optional] | +|**getterOptions** | **Map<String, String>** | | [optional] | +|**getterSource** | **String** | | [optional] | +|**relativeDest** | **String** | | [optional] | diff --git a/clients/java/v1/docs/TaskCSIPluginConfig.md b/clients/java/v1/docs/TaskCSIPluginConfig.md index e040bf68..2d95e56a 100644 --- a/clients/java/v1/docs/TaskCSIPluginConfig.md +++ b/clients/java/v1/docs/TaskCSIPluginConfig.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**healthTimeout** | **Long** | | [optional] -**ID** | **String** | | [optional] -**mountDir** | **String** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +| ----------------- | ---------- | ----------- | ---------- | +| **healthTimeout** | **Long** | | [optional] | +| **ID** | **String** | | [optional] | +| **mountDir** | **String** | | [optional] | +| **type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/TaskDiff.md b/clients/java/v1/docs/TaskDiff.md index 0882f19c..3ea7ec7c 100644 --- a/clients/java/v1/docs/TaskDiff.md +++ b/clients/java/v1/docs/TaskDiff.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**annotations** | **List<String>** | | [optional] -**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] -**name** | **String** | | [optional] -**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**annotations** | **List<String>** | | [optional] | +|**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] | +|**name** | **String** | | [optional] | +|**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/TaskEvent.md b/clients/java/v1/docs/TaskEvent.md index 0102435e..71f8d839 100644 --- a/clients/java/v1/docs/TaskEvent.md +++ b/clients/java/v1/docs/TaskEvent.md @@ -5,33 +5,33 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**details** | **Map<String, String>** | | [optional] -**diskLimit** | **Long** | | [optional] -**diskSize** | **Long** | | [optional] -**displayMessage** | **String** | | [optional] -**downloadError** | **String** | | [optional] -**driverError** | **String** | | [optional] -**driverMessage** | **String** | | [optional] -**exitCode** | **Integer** | | [optional] -**failedSibling** | **String** | | [optional] -**failsTask** | **Boolean** | | [optional] -**genericSource** | **String** | | [optional] -**killError** | **String** | | [optional] -**killReason** | **String** | | [optional] -**killTimeout** | **Long** | | [optional] -**message** | **String** | | [optional] -**restartReason** | **String** | | [optional] -**setupError** | **String** | | [optional] -**signal** | **Integer** | | [optional] -**startDelay** | **Long** | | [optional] -**taskSignal** | **String** | | [optional] -**taskSignalReason** | **String** | | [optional] -**time** | **Long** | | [optional] -**type** | **String** | | [optional] -**validationError** | **String** | | [optional] -**vaultError** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**details** | **Map<String, String>** | | [optional] | +|**diskLimit** | **Long** | | [optional] | +|**diskSize** | **Long** | | [optional] | +|**displayMessage** | **String** | | [optional] | +|**downloadError** | **String** | | [optional] | +|**driverError** | **String** | | [optional] | +|**driverMessage** | **String** | | [optional] | +|**exitCode** | **Integer** | | [optional] | +|**failedSibling** | **String** | | [optional] | +|**failsTask** | **Boolean** | | [optional] | +|**genericSource** | **String** | | [optional] | +|**killError** | **String** | | [optional] | +|**killReason** | **String** | | [optional] | +|**killTimeout** | **Long** | | [optional] | +|**message** | **String** | | [optional] | +|**restartReason** | **String** | | [optional] | +|**setupError** | **String** | | [optional] | +|**signal** | **Integer** | | [optional] | +|**startDelay** | **Long** | | [optional] | +|**taskSignal** | **String** | | [optional] | +|**taskSignalReason** | **String** | | [optional] | +|**time** | **Long** | | [optional] | +|**type** | **String** | | [optional] | +|**validationError** | **String** | | [optional] | +|**vaultError** | **String** | | [optional] | diff --git a/clients/java/v1/docs/TaskGroup.md b/clients/java/v1/docs/TaskGroup.md index 60a81963..5e8aafc7 100644 --- a/clients/java/v1/docs/TaskGroup.md +++ b/clients/java/v1/docs/TaskGroup.md @@ -5,28 +5,28 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] -**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] -**consul** | [**Consul**](Consul.md) | | [optional] -**count** | **Integer** | | [optional] -**ephemeralDisk** | [**EphemeralDisk**](EphemeralDisk.md) | | [optional] -**maxClientDisconnect** | **Long** | | [optional] -**meta** | **Map<String, String>** | | [optional] -**migrate** | [**MigrateStrategy**](MigrateStrategy.md) | | [optional] -**name** | **String** | | [optional] -**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] -**reschedulePolicy** | [**ReschedulePolicy**](ReschedulePolicy.md) | | [optional] -**restartPolicy** | [**RestartPolicy**](RestartPolicy.md) | | [optional] -**scaling** | [**ScalingPolicy**](ScalingPolicy.md) | | [optional] -**services** | [**List<Service>**](Service.md) | | [optional] -**shutdownDelay** | **Long** | | [optional] -**spreads** | [**List<Spread>**](Spread.md) | | [optional] -**stopAfterClientDisconnect** | **Long** | | [optional] -**tasks** | [**List<Task>**](Task.md) | | [optional] -**update** | [**UpdateStrategy**](UpdateStrategy.md) | | [optional] -**volumes** | [**Map<String, VolumeRequest>**](VolumeRequest.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**affinities** | [**List<Affinity>**](Affinity.md) | | [optional] | +|**constraints** | [**List<Constraint>**](Constraint.md) | | [optional] | +|**consul** | [**Consul**](Consul.md) | | [optional] | +|**count** | **Integer** | | [optional] | +|**ephemeralDisk** | [**EphemeralDisk**](EphemeralDisk.md) | | [optional] | +|**maxClientDisconnect** | **Long** | | [optional] | +|**meta** | **Map<String, String>** | | [optional] | +|**migrate** | [**MigrateStrategy**](MigrateStrategy.md) | | [optional] | +|**name** | **String** | | [optional] | +|**networks** | [**List<NetworkResource>**](NetworkResource.md) | | [optional] | +|**reschedulePolicy** | [**ReschedulePolicy**](ReschedulePolicy.md) | | [optional] | +|**restartPolicy** | [**RestartPolicy**](RestartPolicy.md) | | [optional] | +|**scaling** | [**ScalingPolicy**](ScalingPolicy.md) | | [optional] | +|**services** | [**List<Service>**](Service.md) | | [optional] | +|**shutdownDelay** | **Long** | | [optional] | +|**spreads** | [**List<Spread>**](Spread.md) | | [optional] | +|**stopAfterClientDisconnect** | **Long** | | [optional] | +|**tasks** | [**List<Task>**](Task.md) | | [optional] | +|**update** | [**UpdateStrategy**](UpdateStrategy.md) | | [optional] | +|**volumes** | [**Map<String, VolumeRequest>**](VolumeRequest.md) | | [optional] | diff --git a/clients/java/v1/docs/TaskGroupDiff.md b/clients/java/v1/docs/TaskGroupDiff.md index 5de0ffbb..be2fd3d6 100644 --- a/clients/java/v1/docs/TaskGroupDiff.md +++ b/clients/java/v1/docs/TaskGroupDiff.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] -**name** | **String** | | [optional] -**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] -**tasks** | [**List<TaskDiff>**](TaskDiff.md) | | [optional] -**type** | **String** | | [optional] -**updates** | **Map<String, Integer>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | [**List<FieldDiff>**](FieldDiff.md) | | [optional] | +|**name** | **String** | | [optional] | +|**objects** | [**List<ObjectDiff>**](ObjectDiff.md) | | [optional] | +|**tasks** | [**List<TaskDiff>**](TaskDiff.md) | | [optional] | +|**type** | **String** | | [optional] | +|**updates** | **Map<String, Integer>** | | [optional] | diff --git a/clients/java/v1/docs/TaskGroupScaleStatus.md b/clients/java/v1/docs/TaskGroupScaleStatus.md index 95f09629..b2ad4d11 100644 --- a/clients/java/v1/docs/TaskGroupScaleStatus.md +++ b/clients/java/v1/docs/TaskGroupScaleStatus.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**desired** | **Integer** | | [optional] -**events** | [**List<ScalingEvent>**](ScalingEvent.md) | | [optional] -**healthy** | **Integer** | | [optional] -**placed** | **Integer** | | [optional] -**running** | **Integer** | | [optional] -**unhealthy** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**desired** | **Integer** | | [optional] | +|**events** | [**List<ScalingEvent>**](ScalingEvent.md) | | [optional] | +|**healthy** | **Integer** | | [optional] | +|**placed** | **Integer** | | [optional] | +|**running** | **Integer** | | [optional] | +|**unhealthy** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/TaskGroupSummary.md b/clients/java/v1/docs/TaskGroupSummary.md index 2adaa73f..df10f9b7 100644 --- a/clients/java/v1/docs/TaskGroupSummary.md +++ b/clients/java/v1/docs/TaskGroupSummary.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**complete** | **Integer** | | [optional] -**failed** | **Integer** | | [optional] -**lost** | **Integer** | | [optional] -**queued** | **Integer** | | [optional] -**running** | **Integer** | | [optional] -**starting** | **Integer** | | [optional] -**unknown** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**complete** | **Integer** | | [optional] | +|**failed** | **Integer** | | [optional] | +|**lost** | **Integer** | | [optional] | +|**queued** | **Integer** | | [optional] | +|**running** | **Integer** | | [optional] | +|**starting** | **Integer** | | [optional] | +|**unknown** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/TaskHandle.md b/clients/java/v1/docs/TaskHandle.md index e12917fb..358c98ce 100644 --- a/clients/java/v1/docs/TaskHandle.md +++ b/clients/java/v1/docs/TaskHandle.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**driverState** | **byte[]** | | [optional] -**version** | **Integer** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**driverState** | **byte[]** | | [optional] | +|**version** | **Integer** | | [optional] | diff --git a/clients/java/v1/docs/TaskLifecycle.md b/clients/java/v1/docs/TaskLifecycle.md index 000f3e04..4ea8211e 100644 --- a/clients/java/v1/docs/TaskLifecycle.md +++ b/clients/java/v1/docs/TaskLifecycle.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hook** | **String** | | [optional] -**sidecar** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hook** | **String** | | [optional] | +|**sidecar** | **Boolean** | | [optional] | diff --git a/clients/java/v1/docs/TaskState.md b/clients/java/v1/docs/TaskState.md index 831f1e8f..7bd428d5 100644 --- a/clients/java/v1/docs/TaskState.md +++ b/clients/java/v1/docs/TaskState.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**List<TaskEvent>**](TaskEvent.md) | | [optional] -**failed** | **Boolean** | | [optional] -**finishedAt** | **OffsetDateTime** | | [optional] -**lastRestart** | **OffsetDateTime** | | [optional] -**restarts** | **Integer** | | [optional] -**startedAt** | **OffsetDateTime** | | [optional] -**state** | **String** | | [optional] -**taskHandle** | [**TaskHandle**](TaskHandle.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**events** | [**List<TaskEvent>**](TaskEvent.md) | | [optional] | +|**failed** | **Boolean** | | [optional] | +|**finishedAt** | **OffsetDateTime** | | [optional] | +|**lastRestart** | **OffsetDateTime** | | [optional] | +|**restarts** | **Integer** | | [optional] | +|**startedAt** | **OffsetDateTime** | | [optional] | +|**state** | **String** | | [optional] | +|**taskHandle** | [**TaskHandle**](TaskHandle.md) | | [optional] | diff --git a/clients/java/v1/docs/Template.md b/clients/java/v1/docs/Template.md index 6da26dd2..1f854cd7 100644 --- a/clients/java/v1/docs/Template.md +++ b/clients/java/v1/docs/Template.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**changeMode** | **String** | | [optional] -**changeSignal** | **String** | | [optional] -**destPath** | **String** | | [optional] -**embeddedTmpl** | **String** | | [optional] -**envvars** | **Boolean** | | [optional] -**leftDelim** | **String** | | [optional] -**perms** | **String** | | [optional] -**rightDelim** | **String** | | [optional] -**sourcePath** | **String** | | [optional] -**splay** | **Long** | | [optional] -**vaultGrace** | **Long** | | [optional] -**wait** | [**WaitConfig**](WaitConfig.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**changeMode** | **String** | | [optional] | +|**changeSignal** | **String** | | [optional] | +|**destPath** | **String** | | [optional] | +|**embeddedTmpl** | **String** | | [optional] | +|**envvars** | **Boolean** | | [optional] | +|**leftDelim** | **String** | | [optional] | +|**perms** | **String** | | [optional] | +|**rightDelim** | **String** | | [optional] | +|**sourcePath** | **String** | | [optional] | +|**splay** | **Long** | | [optional] | +|**vaultGrace** | **Long** | | [optional] | +|**wait** | [**WaitConfig**](WaitConfig.md) | | [optional] | diff --git a/clients/java/v1/docs/UpdateStrategy.md b/clients/java/v1/docs/UpdateStrategy.md index 95feab49..f0a54206 100644 --- a/clients/java/v1/docs/UpdateStrategy.md +++ b/clients/java/v1/docs/UpdateStrategy.md @@ -5,17 +5,17 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**autoPromote** | **Boolean** | | [optional] -**autoRevert** | **Boolean** | | [optional] -**canary** | **Integer** | | [optional] -**healthCheck** | **String** | | [optional] -**healthyDeadline** | **Long** | | [optional] -**maxParallel** | **Integer** | | [optional] -**minHealthyTime** | **Long** | | [optional] -**progressDeadline** | **Long** | | [optional] -**stagger** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**autoPromote** | **Boolean** | | [optional] | +|**autoRevert** | **Boolean** | | [optional] | +|**canary** | **Integer** | | [optional] | +|**healthCheck** | **String** | | [optional] | +|**healthyDeadline** | **Long** | | [optional] | +|**maxParallel** | **Integer** | | [optional] | +|**minHealthyTime** | **Long** | | [optional] | +|**progressDeadline** | **Long** | | [optional] | +|**stagger** | **Long** | | [optional] | diff --git a/clients/java/v1/docs/Vault.md b/clients/java/v1/docs/Vault.md index 1c9a4afb..d8127cd2 100644 --- a/clients/java/v1/docs/Vault.md +++ b/clients/java/v1/docs/Vault.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**changeMode** | **String** | | [optional] -**changeSignal** | **String** | | [optional] -**env** | **Boolean** | | [optional] -**namespace** | **String** | | [optional] -**policies** | **List<String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**changeMode** | **String** | | [optional] | +|**changeSignal** | **String** | | [optional] | +|**env** | **Boolean** | | [optional] | +|**namespace** | **String** | | [optional] | +|**policies** | **List<String>** | | [optional] | diff --git a/clients/java/v1/docs/VolumeMount.md b/clients/java/v1/docs/VolumeMount.md index 8c8e7264..d8e5b06d 100644 --- a/clients/java/v1/docs/VolumeMount.md +++ b/clients/java/v1/docs/VolumeMount.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**destination** | **String** | | [optional] -**propagationMode** | **String** | | [optional] -**readOnly** | **Boolean** | | [optional] -**volume** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**destination** | **String** | | [optional] | +|**propagationMode** | **String** | | [optional] | +|**readOnly** | **Boolean** | | [optional] | +|**volume** | **String** | | [optional] | diff --git a/clients/java/v1/docs/VolumeRequest.md b/clients/java/v1/docs/VolumeRequest.md index 520a400e..62bcf4ba 100644 --- a/clients/java/v1/docs/VolumeRequest.md +++ b/clients/java/v1/docs/VolumeRequest.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessMode** | **String** | | [optional] -**attachmentMode** | **String** | | [optional] -**mountOptions** | [**CSIMountOptions**](CSIMountOptions.md) | | [optional] -**name** | **String** | | [optional] -**perAlloc** | **Boolean** | | [optional] -**readOnly** | **Boolean** | | [optional] -**source** | **String** | | [optional] -**type** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessMode** | **String** | | [optional] | +|**attachmentMode** | **String** | | [optional] | +|**mountOptions** | [**CSIMountOptions**](CSIMountOptions.md) | | [optional] | +|**name** | **String** | | [optional] | +|**perAlloc** | **Boolean** | | [optional] | +|**readOnly** | **Boolean** | | [optional] | +|**source** | **String** | | [optional] | +|**type** | **String** | | [optional] | diff --git a/clients/java/v1/docs/VolumesApi.md b/clients/java/v1/docs/VolumesApi.md index 14c8904c..f6821b61 100644 --- a/clients/java/v1/docs/VolumesApi.md +++ b/clients/java/v1/docs/VolumesApi.md @@ -2,19 +2,19 @@ All URIs are relative to *https://127.0.0.1:4646/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createVolume**](VolumesApi.md#createVolume) | **POST** /volume/csi/{volumeId}/{action} | -[**deleteSnapshot**](VolumesApi.md#deleteSnapshot) | **DELETE** /volumes/snapshot | -[**deleteVolumeRegistration**](VolumesApi.md#deleteVolumeRegistration) | **DELETE** /volume/csi/{volumeId} | -[**detachOrDeleteVolume**](VolumesApi.md#detachOrDeleteVolume) | **DELETE** /volume/csi/{volumeId}/{action} | -[**getExternalVolumes**](VolumesApi.md#getExternalVolumes) | **GET** /volumes/external | -[**getSnapshots**](VolumesApi.md#getSnapshots) | **GET** /volumes/snapshot | -[**getVolume**](VolumesApi.md#getVolume) | **GET** /volume/csi/{volumeId} | -[**getVolumes**](VolumesApi.md#getVolumes) | **GET** /volumes | -[**postSnapshot**](VolumesApi.md#postSnapshot) | **POST** /volumes/snapshot | -[**postVolume**](VolumesApi.md#postVolume) | **POST** /volumes | -[**postVolumeRegistration**](VolumesApi.md#postVolumeRegistration) | **POST** /volume/csi/{volumeId} | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createVolume**](VolumesApi.md#createVolume) | **POST** /volume/csi/{volumeId}/{action} | | +| [**deleteSnapshot**](VolumesApi.md#deleteSnapshot) | **DELETE** /volumes/snapshot | | +| [**deleteVolumeRegistration**](VolumesApi.md#deleteVolumeRegistration) | **DELETE** /volume/csi/{volumeId} | | +| [**detachOrDeleteVolume**](VolumesApi.md#detachOrDeleteVolume) | **DELETE** /volume/csi/{volumeId}/{action} | | +| [**getExternalVolumes**](VolumesApi.md#getExternalVolumes) | **GET** /volumes/external | | +| [**getSnapshots**](VolumesApi.md#getSnapshots) | **GET** /volumes/snapshot | | +| [**getVolume**](VolumesApi.md#getVolume) | **GET** /volume/csi/{volumeId} | | +| [**getVolumes**](VolumesApi.md#getVolumes) | **GET** /volumes | | +| [**postSnapshot**](VolumesApi.md#postSnapshot) | **POST** /volumes/snapshot | | +| [**postVolume**](VolumesApi.md#postVolume) | **POST** /volumes | | +| [**postVolumeRegistration**](VolumesApi.md#postVolumeRegistration) | **POST** /volume/csi/{volumeId} | | @@ -67,15 +67,15 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **volumeId** | **String**| Volume unique identifier. | - **action** | **String**| The action to perform on the Volume (create, detach, delete). | - **csIVolumeCreateRequest** | [**CSIVolumeCreateRequest**](CSIVolumeCreateRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **volumeId** | **String**| Volume unique identifier. | | +| **action** | **String**| The action to perform on the Volume (create, detach, delete). | | +| **csIVolumeCreateRequest** | [**CSIVolumeCreateRequest**](CSIVolumeCreateRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -93,11 +93,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **deleteSnapshot** @@ -148,14 +148,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] - **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] - **snapshotId** | **String**| The ID of the snapshot to target. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | +| **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] | +| **snapshotId** | **String**| The ID of the snapshot to target. | [optional] | ### Return type @@ -173,11 +173,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **deleteVolumeRegistration** @@ -228,14 +228,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **volumeId** | **String**| Volume unique identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] - **force** | **String**| Used to force the de-registration of a volume. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **volumeId** | **String**| Volume unique identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | +| **force** | **String**| Used to force the de-registration of a volume. | [optional] | ### Return type @@ -253,11 +253,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **detachOrDeleteVolume** @@ -309,15 +309,15 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **volumeId** | **String**| Volume unique identifier. | - **action** | **String**| The action to perform on the Volume (create, detach, delete). | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] - **node** | **String**| Specifies node to target volume operation for. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **volumeId** | **String**| Volume unique identifier. | | +| **action** | **String**| The action to perform on the Volume (create, detach, delete). | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | +| **node** | **String**| Specifies node to target volume operation for. | [optional] | ### Return type @@ -335,11 +335,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getExternalVolumes** @@ -395,18 +395,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] | ### Return type @@ -424,11 +424,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getSnapshots** @@ -484,18 +484,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] | ### Return type @@ -513,11 +513,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getVolume** @@ -573,18 +573,18 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **volumeId** | **String**| Volume unique identifier. | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **volumeId** | **String**| Volume unique identifier. | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | ### Return type @@ -602,11 +602,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **getVolumes** @@ -664,20 +664,20 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] - **wait** | **String**| Provided with IndexParam to wait for change. | [optional] - **stale** | **String**| If present, results will include stale reads. | [optional] - **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **perPage** | **Integer**| Maximum number of results to return. | [optional] - **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] - **nodeId** | **String**| Filters volume lists by node ID. | [optional] - **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] - **type** | **String**| Filters volume lists to a specific type. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **index** | **Integer**| If set, wait until query exceeds given index. Must be provided with WaitParam. | [optional] | +| **wait** | **String**| Provided with IndexParam to wait for change. | [optional] | +| **stale** | **String**| If present, results will include stale reads. | [optional] | +| **prefix** | **String**| Constrains results to jobs that start with the defined prefix | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **perPage** | **Integer**| Maximum number of results to return. | [optional] | +| **nextToken** | **String**| Indicates where to start paging for queries that support pagination. | [optional] | +| **nodeId** | **String**| Filters volume lists by node ID. | [optional] | +| **pluginId** | **String**| Filters volume lists by plugin ID. | [optional] | +| **type** | **String**| Filters volume lists to a specific type. | [optional] | ### Return type @@ -695,11 +695,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postSnapshot** @@ -750,13 +750,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **csISnapshotCreateRequest** | [**CSISnapshotCreateRequest**](CSISnapshotCreateRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **csISnapshotCreateRequest** | [**CSISnapshotCreateRequest**](CSISnapshotCreateRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -774,11 +774,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postVolume** @@ -828,13 +828,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **csIVolumeRegisterRequest** | [**CSIVolumeRegisterRequest**](CSIVolumeRegisterRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **csIVolumeRegisterRequest** | [**CSIVolumeRegisterRequest**](CSIVolumeRegisterRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -852,11 +852,11 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | # **postVolumeRegistration** @@ -907,14 +907,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **volumeId** | **String**| Volume unique identifier. | - **csIVolumeRegisterRequest** | [**CSIVolumeRegisterRequest**](CSIVolumeRegisterRequest.md)| | - **region** | **String**| Filters results based on the specified region. | [optional] - **namespace** | **String**| Filters results based on the specified namespace. | [optional] - **xNomadToken** | **String**| A Nomad ACL token. | [optional] - **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **volumeId** | **String**| Volume unique identifier. | | +| **csIVolumeRegisterRequest** | [**CSIVolumeRegisterRequest**](CSIVolumeRegisterRequest.md)| | | +| **region** | **String**| Filters results based on the specified region. | [optional] | +| **namespace** | **String**| Filters results based on the specified namespace. | [optional] | +| **xNomadToken** | **String**| A Nomad ACL token. | [optional] | +| **idempotencyToken** | **String**| Can be used to ensure operations are only run once. | [optional] | ### Return type @@ -932,9 +932,9 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| -**400** | Bad request | - | -**403** | Forbidden | - | -**405** | Method not allowed | - | -**500** | Internal server error | - | +| **200** | | * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
| +| **400** | Bad request | - | +| **403** | Forbidden | - | +| **405** | Method not allowed | - | +| **500** | Internal server error | - | diff --git a/clients/java/v1/docs/WaitConfig.md b/clients/java/v1/docs/WaitConfig.md index d6435e26..6f13da58 100644 --- a/clients/java/v1/docs/WaitConfig.md +++ b/clients/java/v1/docs/WaitConfig.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**max** | **Long** | | [optional] -**min** | **Long** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**max** | **Long** | | [optional] | +|**min** | **Long** | | [optional] | diff --git a/clients/java/v1/gradle.properties b/clients/java/v1/gradle.properties index 05644f07..a3408578 100644 --- a/clients/java/v1/gradle.properties +++ b/clients/java/v1/gradle.properties @@ -1,2 +1,6 @@ -# Uncomment to build for Android -#target = android \ No newline at end of file +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/clients/java/v1/gradle/wrapper/gradle-wrapper.jar b/clients/java/v1/gradle/wrapper/gradle-wrapper.jar index e708b1c023ec8b20f512888fe07c5bd3ff77bb8f..7454180f2ae8848c63b8b4dea2cb829da983f2fa 100644 GIT binary patch delta 18435 zcmY&<19zBR)MXm8v2EM7ZQHi-#I|kQZfv7Tn#Q)%81v4zX3d)U4d4 zYYc!v@NU%|U;_sM`2z(4BAilWijmR>4U^KdN)D8%@2KLcqkTDW%^3U(Wg>{qkAF z&RcYr;D1I5aD(N-PnqoEeBN~JyXiT(+@b`4Pv`;KmkBXYN48@0;iXuq6!ytn`vGp$ z6X4DQHMx^WlOek^bde&~cvEO@K$oJ}i`T`N;M|lX0mhmEH zuRpo!rS~#&rg}ajBdma$$}+vEhz?JAFUW|iZEcL%amAg_pzqul-B7Itq6Y_BGmOCC zX*Bw3rFz3R)DXpCVBkI!SoOHtYstv*e-May|+?b80ZRh$MZ$FerlC`)ZKt} zTd0Arf9N2dimjs>mg5&@sfTPsRXKXI;0L~&t+GH zkB<>wxI9D+k5VHHcB7Rku{Z>i3$&hgd9Mt_hS_GaGg0#2EHzyV=j=u5xSyV~F0*qs zW{k9}lFZ?H%@4hII_!bzao!S(J^^ZZVmG_;^qXkpJb7OyR*sPL>))Jx{K4xtO2xTr@St!@CJ=y3q2wY5F`77Tqwz8!&Q{f7Dp zifvzVV1!Dj*dxG%BsQyRP6${X+Tc$+XOG zzvq5xcC#&-iXlp$)L=9t{oD~bT~v^ZxQG;FRz|HcZj|^L#_(VNG)k{=_6|6Bs-tRNCn-XuaZ^*^hpZ@qwi`m|BxcF6IWc?_bhtK_cDZRTw#*bZ2`1@1HcB`mLUmo_>@2R&nj7&CiH zF&laHkG~7#U>c}rn#H)q^|sk+lc!?6wg0xy`VPn!{4P=u@cs%-V{VisOxVqAR{XX+ zw}R;{Ux@6A_QPka=48|tph^^ZFjSHS1BV3xfrbY84^=?&gX=bmz(7C({=*oy|BEp+ zYgj;<`j)GzINJA>{HeSHC)bvp6ucoE`c+6#2KzY9)TClmtEB1^^Mk)(mXWYvup02e%Ghm9qyjz#fO3bNGBX} zFiB>dvc1+If!>I10;qZk`?6pEd*(?bI&G*3YLt;MWw&!?=Mf7%^Op?qnyXWur- zwX|S^P>jF?{m9c&mmK-epCRg#WB+-VDe!2d2~YVoi%7_q(dyC{(}zB${!ElKB2D}P z7QNFM!*O^?FrPMGZ}wQ0TrQAVqZy!weLhu_Zq&`rlD39r*9&2sJHE(JT0EY5<}~x@ z1>P0!L2IFDqAB!($H9s2fI`&J_c+5QT|b#%99HA3@zUWOuYh(~7q7!Pf_U3u!ij5R zjFzeZta^~RvAmd_TY+RU@e}wQaB_PNZI26zmtzT4iGJg9U(Wrgrl>J%Z3MKHOWV(? zj>~Ph$<~8Q_sI+)$DOP^9FE6WhO09EZJ?1W|KidtEjzBX3RCLUwmj9qH1CM=^}MaK z59kGxRRfH(n|0*lkE?`Rpn6d^u5J6wPfi0WF(rucTv(I;`aW)3;nY=J=igkjsn?ED ztH&ji>}TW8)o!Jg@9Z}=i2-;o4#xUksQHu}XT~yRny|kg-$Pqeq!^78xAz2mYP9+4 z9gwAoti2ICvUWxE&RZ~}E)#M8*zy1iwz zHqN%q;u+f6Ti|SzILm0s-)=4)>eb5o-0K zbMW8ecB4p^6OuIX@u`f{>Yn~m9PINEl#+t*jqalwxIx=TeGB9(b6jA}9VOHnE$9sC zH`;epyH!k-3kNk2XWXW!K`L_G!%xOqk0ljPCMjK&VweAxEaZ==cT#;!7)X&C|X{dY^IY(e4D#!tx^vV3NZqK~--JW~wtXJ8X19adXim?PdN(|@o(OdgH3AiHts~?#QkolO?*=U_buYC&tQ3sc(O5HGHN~=6wB@dgIAVT$ z_OJWJ^&*40Pw&%y^t8-Wn4@l9gOl`uU z{Uda_uk9!Iix?KBu9CYwW9Rs=yt_lE11A+k$+)pkY5pXpocxIEJe|pTxwFgB%Kpr&tH;PzgOQ&m|(#Otm?@H^r`v)9yiR8v&Uy>d#TNdRfyN4Jk;`g zp+jr5@L2A7TS4=G-#O<`A9o;{En5!I8lVUG?!PMsv~{E_yP%QqqTxxG%8%KxZ{uwS zOT+EA5`*moN8wwV`Z=wp<3?~f#frmID^K?t7YL`G^(X43gWbo!6(q*u%HxWh$$^2EOq`Hj zp=-fS#Av+s9r-M)wGIggQ)b<@-BR`R8l1G@2+KODmn<_$Tzb7k35?e8;!V0G>`(!~ zY~qZz!6*&|TupOcnvsQYPbcMiJ!J{RyfezB^;fceBk znpA1XS)~KcC%0^_;ihibczSxwBuy;^ksH7lwfq7*GU;TLt*WmUEVQxt{ zKSfJf;lk$0XO8~48Xn2dnh8tMC9WHu`%DZj&a`2!tNB`5%;Md zBs|#T0Ktf?vkWQ)Y+q!At1qgL`C|nbzvgc(+28Q|4N6Geq)Il%+I5c@t02{9^=QJ?=h2BTe`~BEu=_u3xX2&?^zwcQWL+)7dI>JK0g8_`W1n~ zMaEP97X>Ok#=G*nkPmY`VoP8_{~+Rp7DtdSyWxI~?TZHxJ&=6KffcO2Qx1?j7=LZA z?GQt`oD9QpXw+s7`t+eeLO$cpQpl9(6h3_l9a6OUpbwBasCeCw^UB6we!&h9Ik@1zvJ`j4i=tvG9X8o34+N|y(ay~ho$f=l z514~mP>Z>#6+UxM<6@4z*|hFJ?KnkQBs_9{H(-v!_#Vm6Z4(xV5WgWMd3mB9A(>@XE292#k(HdI7P zJkQ2)`bQXTKlr}{VrhSF5rK9TsjtGs0Rs&nUMcH@$ZX_`Hh$Uje*)(Wd&oLW($hZQ z_tPt`{O@f8hZ<}?aQc6~|9iHt>=!%We3=F9yIfiqhXqp=QUVa!@UY@IF5^dr5H8$R zIh{=%S{$BHG+>~a=vQ={!B9B=<-ID=nyjfA0V8->gN{jRL>Qc4Rc<86;~aY+R!~Vs zV7MI~gVzGIY`B*Tt@rZk#Lg}H8sL39OE31wr_Bm%mn}8n773R&N)8B;l+-eOD@N$l zh&~Wz`m1qavVdxwtZLACS(U{rAa0;}KzPq9r76xL?c{&GaG5hX_NK!?)iq`t7q*F# zFoKI{h{*8lb>&sOeHXoAiqm*vV6?C~5U%tXR8^XQ9Y|(XQvcz*>a?%HQ(Vy<2UhNf zVmGeOO#v159KV@1g`m%gJ)XGPLa`a|?9HSzSSX{j;)xg>G(Ncc7+C>AyAWYa(k}5B3mtzg4tsA=C^Wfezb1&LlyrBE1~kNfeiubLls{C)!<%#m@f}v^o+7<VZ6!FZ;JeiAG@5vw7Li{flC8q1%jD_WP2ApBI{fQ}kN zhvhmdZ0bb5(qK@VS5-)G+@GK(tuF6eJuuV5>)Odgmt?i_`tB69DWpC~e8gqh!>jr_ zL1~L0xw@CbMSTmQflpRyjif*Y*O-IVQ_OFhUw-zhPrXXW>6X}+73IoMsu2?uuK3lT>;W#38#qG5tDl66A7Y{mYh=jK8Se!+f=N7%nv zYSHr6a~Nxd`jqov9VgII{%EpC_jFCEc>>SND0;}*Ja8Kv;G)MK7?T~h((c&FEBcQq zvUU1hW2^TX(dDCeU@~a1LF-(+#lz3997A@pipD53&Dr@III2tlw>=!iGabjXzbyUJ z4Hi~M1KCT-5!NR#I%!2Q*A>mqI{dpmUa_mW)%SDs{Iw1LG}0y=wbj@0ba-`q=0!`5 zr(9q1p{#;Rv2CY!L#uTbs(UHVR5+hB@m*zEf4jNu3(Kj$WwW|v?YL*F_0x)GtQC~! zzrnZRmBmwt+i@uXnk05>uR5&1Ddsx1*WwMrIbPD3yU*2By`71pk@gt{|H0D<#B7&8 z2dVmXp*;B)SWY)U1VSNs4ds!yBAj;P=xtatUx^7_gC5tHsF#vvdV;NmKwmNa1GNWZ zi_Jn-B4GnJ%xcYWD5h$*z^haku#_Irh818x^KB)3-;ufjf)D0TE#6>|zFf@~pU;Rs zNw+}c9S+6aPzxkEA6R%s*xhJ37wmgc)-{Zd1&mD5QT}4BQvczWr-Xim>(P^)52`@R z9+Z}44203T5}`AM_G^Snp<_KKc!OrA(5h7{MT^$ZeDsSr(R@^kI?O;}QF)OU zQ9-`t^ys=6DzgLcWt0U{Q(FBs22=r zKD%fLQ^5ZF24c-Z)J{xv?x$&4VhO^mswyb4QTIofCvzq+27*WlYm;h@;Bq%i;{hZA zM97mHI6pP}XFo|^pRTuWQzQs3B-8kY@ajLV!Fb?OYAO3jFv*W-_;AXd;G!CbpZt04iW`Ie^_+cQZGY_Zd@P<*J9EdRsc>c=edf$K|;voXRJ zk*aC@@=MKwR120(%I_HX`3pJ+8GMeO>%30t?~uXT0O-Tu-S{JA;zHoSyXs?Z;fy58 zi>sFtI7hoxNAdOt#3#AWFDW)4EPr4kDYq^`s%JkuO7^efX+u#-qZ56aoRM!tC^P6O zP(cFuBnQGjhX(^LJ(^rVe4-_Vk*3PkBCj!?SsULdmVr0cGJM^=?8b0^DuOFq>0*yA zk1g|C7n%pMS0A8@Aintd$fvRbH?SNdRaFrfoAJ=NoX)G5Gr}3-$^IGF+eI&t{I-GT zp=1fj)2|*ur1Td)+s&w%p#E6tDXX3YYOC{HGHLiCvv?!%%3DO$B$>A}aC;8D0Ef#b z{7NNqC8j+%1n95zq8|hFY`afAB4E)w_&7?oqG0IPJZv)lr{MT}>9p?}Y`=n+^CZ6E zKkjIXPub5!82(B-O2xQojW^P(#Q*;ETpEr^+Wa=qDJ9_k=Wm@fZB6?b(u?LUzX(}+ zE6OyapdG$HC& z&;oa*ALoyIxVvB2cm_N&h&{3ZTuU|aBrJlGOLtZc3KDx)<{ z27@)~GtQF@%6B@w3emrGe?Cv_{iC@a#YO8~OyGRIvp@%RRKC?fclXMP*6GzBFO z5U4QK?~>AR>?KF@I;|(rx(rKxdT9-k-anYS+#S#e1SzKPslK!Z&r8iomPsWG#>`Ld zJ<#+8GFHE!^wsXt(s=CGfVz5K+FHYP5T0E*?0A-z*lNBf)${Y`>Gwc@?j5{Q|6;Bl zkHG1%r$r&O!N^><8AEL+=y(P$7E6hd=>BZ4ZZ9ukJ2*~HR4KGvUR~MUOe$d>E5UK3 z*~O2LK4AnED}4t1Fs$JgvPa*O+WeCji_cn1@Tv7XQ6l@($F1K%{E$!naeX)`bfCG> z8iD<%_M6aeD?a-(Qqu61&fzQqC(E8ksa%CulMnPvR35d{<`VsmaHyzF+B zF6a@1$CT0xGVjofcct4SyxA40uQ`b#9kI)& z?B67-12X-$v#Im4CVUGZHXvPWwuspJ610ITG*A4xMoRVXJl5xbk;OL(;}=+$9?H`b z>u2~yd~gFZ*V}-Q0K6E@p}mtsri&%Zep?ZrPJmv`Qo1>94Lo||Yl)nqwHXEbe)!g( zo`w|LU@H14VvmBjjkl~=(?b{w^G$~q_G(HL`>|aQR%}A64mv0xGHa`S8!*Wb*eB}` zZh)&rkjLK!Rqar)UH)fM<&h&@v*YyOr!Xk2OOMV%$S2mCRdJxKO1RL7xP_Assw)bb z9$sQ30bapFfYTS`i1PihJZYA#0AWNmp>x(;C!?}kZG7Aq?zp!B+gGyJ^FrXQ0E<>2 zCjqZ(wDs-$#pVYP3NGA=en<@_uz!FjFvn1&w1_Igvqs_sL>ExMbcGx4X5f%`Wrri@ z{&vDs)V!rd=pS?G(ricfwPSg(w<8P_6=Qj`qBC7_XNE}1_5>+GBjpURPmvTNE7)~r)Y>ZZecMS7Ro2` z0}nC_GYo3O7j|Wux?6-LFZs%1IV0H`f`l9or-8y0=5VGzjPqO2cd$RRHJIY06Cnh- ztg@Pn1OeY=W`1Mv3`Ti6!@QIT{qcC*&vptnX4Pt1O|dWv8u2s|(CkV`)vBjAC_U5` zCw1f&c4o;LbBSp0=*q z3Y^horBAnR)u=3t?!}e}14%K>^562K!)Vy6r~v({5{t#iRh8WIL|U9H6H97qX09xp zjb0IJ^9Lqxop<-P*VA0By@In*5dq8Pr3bTPu|ArID*4tWM7w+mjit0PgmwLV4&2PW z3MnIzbdR`3tPqtUICEuAH^MR$K_u8~-U2=N1)R=l>zhygus44>6V^6nJFbW-`^)f} zI&h$FK)Mo*x?2`0npTD~jRd}5G~-h8=wL#Y-G+a^C?d>OzsVl7BFAaM==(H zR;ARWa^C3J)`p~_&FRsxt|@e+M&!84`eq)@aO9yBj8iifJv0xVW4F&N-(#E=k`AwJ z3EFXWcpsRlB%l_0Vdu`0G(11F7( zsl~*@XP{jS@?M#ec~%Pr~h z2`M*lIQaolzWN&;hkR2*<=!ORL(>YUMxOzj(60rQfr#wTrkLO!t{h~qg% zv$R}0IqVIg1v|YRu9w7RN&Uh7z$ijV=3U_M(sa`ZF=SIg$uY|=NdC-@%HtkUSEqJv zg|c}mKTCM=Z8YmsFQu7k{VrXtL^!Cts-eb@*v0B3M#3A7JE*)MeW1cfFqz~^S6OXFOIP&iL;Vpy z4dWKsw_1Wn%Y;eW1YOfeP_r1s4*p1C(iDG_hrr~-I%kA>ErxnMWRYu{IcG{sAW;*t z9T|i4bI*g)FXPpKM@~!@a7LDVVGqF}C@mePD$ai|I>73B+9!Ks7W$pw;$W1B%-rb; zJ*-q&ljb=&41dJ^*A0)7>Wa@khGZ;q1fL(2qW=|38j43mTl_;`PEEw07VKY%71l6p z@F|jp88XEnm1p~<5c*cVXvKlj0{THF=n3sU7g>Ki&(ErR;!KSmfH=?49R5(|c_*xw z4$jhCJ1gWT6-g5EV)Ahg?Nw=}`iCyQ6@0DqUb%AZEM^C#?B-@Hmw?LhJ^^VU>&phJ zlB!n5&>I>@sndh~v$2I2Ue23F?0!0}+9H~jg7E`?CS_ERu75^jSwm%!FTAegT`6s7 z^$|%sj2?8wtPQR>@D3sA0-M-g-vL@47YCnxdvd|1mPymvk!j5W1jHnVB&F-0R5e-vs`@u8a5GKdv`LF7uCfKncI4+??Z4iG@AxuX7 z6+@nP^TZ5HX#*z(!y+-KJ3+Ku0M90BTY{SC^{ z&y2#RZPjfX_PE<<>XwGp;g4&wcXsQ0T&XTi(^f+}4qSFH1%^GYi+!rJo~t#ChTeAX zmR0w(iODzQOL+b&{1OqTh*psAb;wT*drr^LKdN?c?HJ*gJl+%kEH&48&S{s28P=%p z7*?(xFW_RYxJxxILS!kdLIJYu@p#mnQ(?moGD1)AxQd66X6b*KN?o&e`u9#N4wu8% z^Gw#G!@|>c740RXziOR=tdbkqf(v~wS_N^CS^1hN-N4{Dww1lvSWcBTX*&9}Cz|s@ z*{O@jZ4RVHq19(HC9xSBZI0M)E;daza+Q*zayrX~N5H4xJ33BD4gn5Ka^Hj{995z4 zzm#Eo?ntC$q1a?)dD$qaC_M{NW!5R!vVZ(XQqS67xR3KP?rA1^+s3M$60WRTVHeTH z6BJO$_jVx0EGPXy}XK_&x597 zt(o6ArN8vZX0?~(lFGHRtHP{gO0y^$iU6Xt2e&v&ugLxfsl;GD)nf~3R^ACqSFLQ< zV7`cXgry((wDMJB55a6D4J;13$z6pupC{-F+wpToW%k1qKjUS^$Mo zN3@}T!ZdpiV7rkNvqP3KbpEn|9aB;@V;gMS1iSb@ zwyD7!5mfj)q+4jE1dq3H`sEKgrVqk|y8{_vmn8bMOi873!rmnu5S=1=-DFx+Oj)Hi zx?~ToiJqOrvSou?RVALltvMADodC7BOg7pOyc4m&6yd(qIuV5?dYUpYzpTe!BuWKi zpTg(JHBYzO&X1e{5o|ZVU-X5e?<}mh=|eMY{ldm>V3NsOGwyxO2h)l#)rH@BI*TN; z`yW26bMSp=k6C4Ja{xB}s`dNp zE+41IwEwo>7*PA|7v-F#jLN>h#a`Er9_86!fwPl{6yWR|fh?c%qc44uP~Ocm2V*(* zICMpS*&aJjxutxKC0Tm8+FBz;3;R^=ajXQUB*nTN*Lb;mruQHUE<&=I7pZ@F-O*VMkJbI#FOrBM8`QEL5Uy=q5e2 z_BwVH%c0^uIWO0*_qD;0jlPoA@sI7BPwOr-mrp7y`|EF)j;$GYdOtEPFRAKyUuUZS z(N4)*6R*ux8s@pMdC*TP?Hx`Zh{{Ser;clg&}CXriXZCr2A!wIoh;j=_eq3_%n7V} za?{KhXg2cXPpKHc90t6=`>s@QF-DNcTJRvLTS)E2FTb+og(wTV7?$kI?QZYgVBn)& zdpJf@tZ{j>B;<MVHiPl_U&KlqBT)$ic+M0uUQWK|N1 zCMl~@o|}!!7yyT%7p#G4?T^Azxt=D(KP{tyx^lD_(q&|zNFgO%!i%7T`>mUuU^FeR zHP&uClWgXm6iXgI8*DEA!O&X#X(zdrNctF{T#pyax16EZ5Lt5Z=RtAja!x+0Z31U8 zjfaky?W)wzd+66$L>o`n;DISQNs09g{GAv%8q2k>2n8q)O^M}=5r#^WR^=se#WSCt zQ`7E1w4qdChz4r@v6hgR?nsaE7pg2B6~+i5 zcTTbBQ2ghUbC-PV(@xvIR(a>Kh?{%YAsMV#4gt1nxBF?$FZ2~nFLKMS!aK=(`WllA zHS<_7ugqKw!#0aUtQwd#A$8|kPN3Af?Tkn)dHF?_?r#X68Wj;|$aw)Wj2Dkw{6)*^ zZfy!TWwh=%g~ECDCy1s8tTgWCi}F1BvTJ9p3H6IFq&zn#3FjZoecA_L_bxGWgeQup zAAs~1IPCnI@H>g|6Lp^Bk)mjrA3_qD4(D(65}l=2RzF-8@h>|Aq!2K-qxt(Q9w7c^ z;gtx`I+=gKOl;h=#fzSgw-V*YT~2_nnSz|!9hIxFb{~dKB!{H zSi??dnmr@%(1w^Be=*Jz5bZeofEKKN&@@uHUMFr-DHS!pb1I&;x9*${bmg6=2I4Zt zHb5LSvojY7ubCNGhp)=95jQ00sMAC{IZdAFsN!lAVQDeiec^HAu=8);2AKqNTT!&E zo+FAR`!A1#T6w@0A+o%&*yzkvxsrqbrfVTG+@z8l4+mRi@j<&)U9n6L>uZoezW>qS zA4YfO;_9dQSyEYpkWnsk0IY}Nr2m(ql@KuQjLgY-@g z4=$uai6^)A5+~^TvLdvhgfd+y?@+tRE^AJabamheJFnpA#O*5_B%s=t8<;?I;qJ}j z&g-9?hbwWEez-!GIhqpB>nFvyi{>Yv>dPU=)qXnr;3v-cd`l}BV?6!v{|cHDOx@IG z;TSiQQ(8=vlH^rCEaZ@Yw}?4#a_Qvx=}BJuxACxm(E7tP4hki^jU@8A zUS|4tTLd)gr@T|F$1eQXPY%fXb7u}(>&9gsd3It^B{W#6F2_g40cgo1^)@-xO&R5X z>qKon+Nvp!4v?-rGQu#M_J2v+3e+?N-WbgPQWf`ZL{Xd9KO^s{uIHTJ6~@d=mc7i z+##ya1p+ZHELmi%3C>g5V#yZt*jMv( zc{m*Y;7v*sjVZ-3mBuaT{$g+^sbs8Rp7BU%Ypi+c%JxtC4O}|9pkF-p-}F{Z7-+45 zDaJQx&CNR)8x~0Yf&M|-1rw%KW3ScjWmKH%J1fBxUp(;F%E+w!U470e_3%+U_q7~P zJm9VSWmZ->K`NfswW(|~fGdMQ!K2z%k-XS?Bh`zrjZDyBMu74Fb4q^A=j6+Vg@{Wc zPRd5Vy*-RS4p1OE-&8f^Fo}^yDj$rb+^>``iDy%t)^pHSV=En5B5~*|32#VkH6S%9 zxgIbsG+|{-$v7mhOww#v-ejaS>u(9KV9_*X!AY#N*LXIxor9hDv%aie@+??X6@Et=xz>6ev9U>6Pn$g4^!}w2Z%Kpqpp+M%mk~?GE-jL&0xLC zy(`*|&gm#mLeoRU8IU?Ujsv=;ab*URmsCl+r?%xcS1BVF*rP}XRR%MO_C!a9J^fOe>U;Y&3aj3 zX`3?i12*^W_|D@VEYR;h&b^s#Kd;JMNbZ#*x8*ZXm(jgw3!jyeHo14Zq!@_Q`V;Dv zKik~!-&%xx`F|l^z2A92aCt4x*I|_oMH9oeqsQgQDgI0j2p!W@BOtCTK8Jp#txi}7 z9kz);EX-2~XmxF5kyAa@n_$YYP^Hd4UPQ>O0-U^-pw1*n{*kdX`Jhz6{!W=V8a$0S z9mYboj#o)!d$gs6vf8I$OVOdZu7L5%)Vo0NhN`SwrQFhP3y4iXe2uV@(G{N{yjNG( zKvcN{k@pXkxyB~9ucR(uPSZ7{~sC=lQtz&V(^A^HppuN!@B4 zS>B=kb14>M-sR>{`teApuHlca6YXs6&sRvRV;9G!XI08CHS~M$=%T~g5Xt~$exVk` zWP^*0h{W%`>K{BktGr@+?ZP}2t0&smjKEVw@3=!rSjw5$gzlx`{dEajg$A58m|Okx zG8@BTPODSk@iqLbS*6>FdVqk}KKHuAHb0UJNnPm!(XO{zg--&@#!niF4T!dGVdNif z3_&r^3+rfQuV^8}2U?bkI5Ng*;&G>(O4&M<86GNxZK{IgKNbRfpg>+32I>(h`T&uv zUN{PRP&onFj$tn1+Yh|0AF330en{b~R+#i9^QIbl9fBv>pN|k&IL2W~j7xbkPyTL^ z*TFONZUS2f33w3)fdzr?)Yg;(s|||=aWZV(nkDaACGSxNCF>XLJSZ=W@?$*` z#sUftY&KqTV+l@2AP5$P-k^N`Bme-xcWPS|5O~arUq~%(z8z87JFB|llS&h>a>Som zC34(_uDViE!H2jI3<@d+F)LYhY)hoW6)i=9u~lM*WH?hI(yA$X#ip}yYld3RAv#1+sBt<)V_9c4(SN9Fn#$}_F}A-}P>N+8io}I3mh!}> z*~*N}ZF4Zergb;`R_g49>ZtTCaEsCHiFb(V{9c@X0`YV2O^@c6~LXg2AE zhA=a~!ALnP6aO9XOC^X15(1T)3!1lNXBEVj5s*G|Wm4YBPV`EOhU&)tTI9-KoLI-U zFI@adu6{w$dvT(zu*#aW*4F=i=!7`P!?hZy(9iL;Z^De3?AW`-gYTPALhrZ*K2|3_ zfz;6xQN9?|;#_U=4t^uS2VkQ8$|?Ub5CgKOj#Ni5j|(zX>x#K(h7LgDP-QHwok~-I zOu9rn%y97qrtKdG=ep)4MKF=TY9^n6CugQ3#G2yx;{))hvlxZGE~rzZ$qEHy-8?pU#G;bwufgSN6?*BeA!7N3RZEh{xS>>-G1!C(e1^ zzd#;39~PE_wFX3Tv;zo>5cc=md{Q}(Rb?37{;YPtAUGZo7j*yHfGH|TOVR#4ACaM2 z;1R0hO(Gl}+0gm9Bo}e@lW)J2OU4nukOTVKshHy7u)tLH^9@QI-jAnDBp(|J8&{fKu=_97$v&F67Z zq+QsJ=gUx3_h_%=+q47msQ*Ub=gMzoSa@S2>`Y9Cj*@Op4plTc!jDhu51nSGI z^sfZ(4=yzlR}kP2rcHRzAY9@T7f`z>fdCU0zibx^gVg&fMkcl)-0bRyWe12bT0}<@ z^h(RgGqS|1y#M;mER;8!CVmX!j=rfNa6>#_^j{^C+SxGhbSJ_a0O|ae!ZxiQCN2qA zKs_Z#Zy|9BOw6x{0*APNm$6tYVG2F$K~JNZ!6>}gJ_NLRYhcIsxY1z~)mt#Yl0pvC zO8#Nod;iow5{B*rUn(0WnN_~~M4|guwfkT(xv;z)olmj=f=aH#Y|#f_*d1H!o( z!EXNxKxth9w1oRr0+1laQceWfgi8z`YS#uzg#s9-QlTT7y2O^^M1PZx z3YS7iegfp6Cs0-ixlG93(JW4wuE7)mfihw}G~Uue{Xb+#F!BkDWs#*cHX^%(We}3% zT%^;m&Juw{hLp^6eyM}J({luCL_$7iRFA6^8B!v|B9P{$42F>|M`4Z_yA{kK()WcM zu#xAZWG%QtiANfX?@+QQOtbU;Avr*_>Yu0C2>=u}zhH9VLp6M>fS&yp*-7}yo8ZWB z{h>ce@HgV?^HgwRThCYnHt{Py0MS=Ja{nIj5%z;0S@?nGQ`z`*EVs&WWNwbzlk`(t zxDSc)$dD+4G6N(p?K>iEKXIk>GlGKTH{08WvrehnHhh%tgpp&8db4*FLN zETA@<$V=I7S^_KxvYv$Em4S{gO>(J#(Wf;Y%(NeECoG3n+o;d~Bjme-4dldKukd`S zRVAnKxOGjWc;L#OL{*BDEA8T=zL8^`J=2N)d&E#?OMUqk&9j_`GX*A9?V-G zdA5QQ#(_Eb^+wDkDiZ6RXL`fck|rVy%)BVv;dvY#`msZ}{x5fmd! zInmWSxvRgXbJ{unxAi*7=Lt&7_e0B#8M5a=Ad0yX#0rvMacnKnXgh>4iiRq<&wit93n!&p zeq~-o37qf)L{KJo3!{l9l9AQb;&>)^-QO4RhG>j`rBlJ09~cbfNMR_~pJD1$UzcGp zOEGTzz01j$=-kLC+O$r8B|VzBotz}sj(rUGOa7PDYwX~9Tum^sW^xjjoncxSz;kqz z$Pz$Ze|sBCTjk7oM&`b5g2mFtuTx>xl{dj*U$L%y-xeQL~|i>KzdUHeep-Yd@}p&L*ig< zgg__3l9T=nbM3bw0Sq&Z2*FA)P~sx0h634BXz0AxV69cED7QGTbK3?P?MENkiy-mV zZ1xV5ry3zIpy>xmThBL0Q!g+Wz@#?6fYvzmEczs(rcujrfCN=^!iWQ6$EM zaCnRThqt~gI-&6v@KZ78unqgv9j6-%TOxpbV`tK{KaoBbhc}$h+rK)5h|bT6wY*t6st-4$e99+Egb#3ip+ERbve08G@Ref&hP)qB&?>B94?eq5i3k;dOuU#!y-@+&5>~!FZik=z4&4|YHy=~!F254 zQAOTZr26}Nc7jzgJ;V~+9ry#?7Z0o*;|Q)k+@a^87lC}}1C)S))f5tk+lMNqw>vh( z`A9E~5m#b9!ZDBltf7QIuMh+VheCoD7nCFhuzThlhA?|8NCt3w?oWW|NDin&&eDU6 zwH`aY=))lpWG?{fda=-auXYp1WIPu&3 zwK|t(Qiqvc@<;1_W#ALDJ}bR;3&v4$9rP)eAg`-~iCte`O^MY+SaP!w%~+{{1tMo` zbp?T%ENs|mHP)Lsxno=nWL&qizR+!Ib=9i%4=B@(Umf$|7!WVxkD%hfRjvxV`Co<; zG*g4QG_>;RE{3V_DOblu$GYm&!+}%>G*yO{-|V9GYG|bH2JIU2iO}ZvY>}Fl%1!OE zZFsirH^$G>BDIy`8;R?lZl|uu@qWj2T5}((RG``6*05AWsVVa2Iu>!F5U>~7_Tlv{ zt=Dpgm~0QVa5mxta+fUt)I0gToeEm9eJX{yYZ~3sLR&nCuyuFWuiDIVJ+-lwViO(E zH+@Rg$&GLueMR$*K8kOl>+aF84Hss5p+dZ8hbW$=bWNIk0paB!qEK$xIm5{*^ad&( zgtA&gb&6FwaaR2G&+L+Pp>t^LrG*-B&Hv;-s(h0QTuYWdnUObu8LRSZoAVd7SJ;%$ zh%V?58mD~3G2X<$H7I)@x?lmbeeSY7X~QiE`dfQ5&K^FB#9e!6!@d9vrSt!);@ZQZ zO#84N5yH$kjm9X4iY#f+U`FKhg=x*FiDoUeu1O5LcC2w&$~5hKB9ZnH+8BpbTGh5T zi_nfmyQY$vQh%ildbR7T;7TKPxSs#vhKR|uup`qi1PufMa(tNCjRbllakshQgn1)a8OO-j8W&aBc_#q1hKDF5-X$h`!CeT z+c#Ial~fDsGAenv7~f@!icm(~)a3OKi((=^zcOb^qH$#DVciGXslUwTd$gt{7)&#a`&Lp ze%AnL0#U?lAl8vUkv$n>bxH*`qOujO0HZkPWZnE0;}0DSEu1O!hg-d9#{&#B1Dm)L zvN%r^hdEt1vR<4zwshg*0_BNrDWjo65be1&_82SW8#iKWs7>TCjUT;-K~*NxpG2P% zovXUo@S|fMGudVSRQrP}J3-Wxq;4xIxJJC|Y#TQBr>pwfy*%=`EUNE*dr-Y?9y9xK zmh1zS@z{^|UL}v**LNYY!?1qIRPTvr!gNXzE{%=-`oKclPrfMKwn` zUwPeIvLcxkIV>(SZ-SeBo-yw~{p!<&_}eELG?wxp zee-V59%@BtB+Z&Xs=O(@P$}v_qy1m=+`!~r^aT> zY+l?+6(L-=P%m4ScfAYR8;f9dyVw)@(;v{|nO#lAPI1xDHXMYt~-BGiP&9y2OQsYdh7-Q1(vL<$u6W0nxVn-qh=nwuRk}{d!uACozccRGx6~xZQ;=#JCE?OuA@;4 zadp$sm}jfgW4?La(pb!3f0B=HUI{5A4b$2rsB|ZGb?3@CTA{|zBf07pYpQ$NM({C6Srv6%_{rVkCndT=1nS}qyEf}Wjtg$e{ng7Wgz$7itYy0sWW_$qld);iUm85GBH)fk3b=2|5mvflm?~inoVo zDH_%e;y`DzoNj|NgZ`U%a9(N*=~8!qqy0Etkxo#`r!!{|(NyT0;5= z8nVZ6AiM+SjMG8J@6c4_f-KXd_}{My?Se1GWP|@wROFpD^5_lu?I%CBzpwi(`x~xh B8dv}T delta 17845 zcmV)CK*GO}(F4QI1F(Jx4W$DjNjn4p0N4ir06~)x5+0MO2`GQvQyWzj|J`gh3(E#l zNGO!HfVMRRN~%`0q^)g%XlN*vP!O#;m*h5VyX@j-1N|HN;8S1vqEAj=eCdn`)tUB9 zXZjcT^`bL6qvL}gvXj%9vrOD+x!Gc_0{$Zg+6lTXG$bmoEBV z*%y^c-mV0~Rjzv%e6eVI)yl>h;TMG)Ft8lqpR`>&IL&`>KDi5l$AavcVh9g;CF0tY zw_S0eIzKD?Nj~e4raA8wxiiImTRzv6;b6|LFmw)!E4=CiJ4I%&axSey4zE-MIh@*! z*P;K2Mx{xVYPLeagKA}Hj=N=1VrWU`ukuBnc14iBG?B}Uj>?=2UMk4|42=()8KOnc zrJzAxxaEIfjw(CKV6F$35u=1qyf(%cY8fXaS9iS?yetY{mQ#Xyat*7sSoM9fJlZqq zyasQ3>D>6p^`ck^Y|kYYZB*G})uAbQ#7)Jeb~glGz@2rPu}zBWDzo5K$tP<|meKV% z{Swf^eq6NBioF)v&~9NLIxHMTKe6gJ@QQ^A6fA!n#u1C&n`aG7TDXKM1Jly-DwTB` z+6?=Y)}hj;C#r5>&x;MCM4U13nuXVK*}@yRY~W3X%>U>*CB2C^K6_OZsXD!nG2RSX zQg*0)$G3%Es$otA@p_1N!hIPT(iSE=8OPZG+t)oFyD~{nevj0gZen$p>U<7}uRE`t5Mk1f4M0K*5 zbn@3IG5I2mk;8K>*RZ zPV6iL006)S001s%0eYj)9hu1 z9o)iQT9(v*sAuZ|ot){RrZ0Qw4{E0A+!Yx_M~#Pj&OPUM&i$RU=Uxu}e*6Sr2ror= z&?lmvFCO$)BY+^+21E>ENWe`I0{02H<-lz&?})gIVFyMWxX0B|0b?S6?qghp3lDgz z2?0|ALJU=7s-~Lb3>9AA5`#UYCl!Xeh^i@bxs5f&SdiD!WN}CIgq&WI4VCW;M!UJL zX2};d^sVj5oVl)OrkapV-C&SrG)*x=X*ru!2s04TjZ`pY$jP)4+%)7&MlpiZ`lgoF zo_p>^4qGz^(Y*uB10dY2kcIbt=$FIdYNqk;~47wf@)6|nJp z1cocL3zDR9N2Pxkw)dpi&_rvMW&Dh0@T*_}(1JFSc0S~Ph2Sr=vy)u*=TY$i_IHSo zR+&dtWFNxHE*!miRJ%o5@~GK^G~4$LzEYR-(B-b(L*3jyTq}M3d0g6sdx!X3-m&O% zK5g`P179KHJKXpIAAX`A2MFUA;`nXx^b?mboVbQgigIHTU8FI>`q53AjWaD&aowtj z{XyIX>c)*nLO~-WZG~>I)4S1d2q@&?nwL)CVSWqWi&m1&#K1!gt`g%O4s$u^->Dwq ziKc&0O9KQ7000OG0000%03-m(e&Y`S09YWC4iYDSty&3q8^?8ij|8zxaCt!zCFq1@ z9TX4Hl68`nY>}cQNW4Ullqp$~SHO~l1!CdFLKK}ij_t^a?I?C^CvlvnZkwiVn>dl2 z2$V(JN{`5`-8ShF_ek6HNRPBlPuIPYu>TAeAV5O2)35r3*_k(Q-h1+h5pb(Zu%oJ__pBsW0n5ILw`!&QR&YV`g0Fe z(qDM!FX_7;`U3rxX#QHT{f%h;)Eursw=*#qvV)~y%^Uo^% zi-%sMe^uz;#Pe;@{JUu05zT*i=u7mU9{MkT`ft(vPdQZoK&2mg=tnf8FsaNQ+QcPg zB>vP8Rd6Z0JoH5_Q`zldg;hx4azQCq*rRZThqlqTRMzn1O3_rQTrHk8LQ<{5UYN~` zM6*~lOGHyAnx&#yCK{i@%N1Us@=6cw=UQxpSE;<(LnnES%6^q^QhBYQ-VCSmIu8wh z@_LmwcFDfAhIn>`%h7L{)iGBzu`Md4dj-m3C8mA9+BL*<>q z#$7^ttIBOE-=^|zmG`K8yUKT{yjLu2SGYsreN0*~9yhFxn4U};Nv1XXj1fH*v-g=3 z@tCPc`YdzQGLp%zXwo*o$m9j-+~nSWls#s|?PyrHO%SUGdk**X9_=|b)Y%^j_V$3S z>mL2A-V)Q}qb(uZipEFVm?}HWc+%G6_K+S+87g-&RkRQ8-{0APDil115eG|&>WQhU zufO*|e`hFks^cJJmx_qNx{ltSp3aT|XgD5-VxGGXb7gkiOG$w^qMVBDjR8%!Sbh72niHRDV* ziFy8LE+*$j?t^6aZP9qt-ow;hzkmhvy*Hn-X^6?yVMbtNbyqZQ^rXg58`gk+I%Wv} zn_)dRq+3xjc8D%}EQ%nnTF7L7m}o9&*^jf`_qvUhVKY7w9Zgxr-0YHWFRd3$l_6UX zpXt^U&TiC*qZWx#pOG6k?3Tg)pra*fw(O6_45>lUBN1U5Qmc>^DHt)5b~Ntjsw!NI z1n4{$HWFeIi)*qvgK^ui;(81VQc1(wJ8C#tjR>Dkjf{xYC^_B^#qrdCc)uZxtgua6 zk98UGQF|;;k`c+0_z)tQ&9DwLB~&12@D1!*mTz_!3Mp=cg;B7Oq4cKN>5v&dW7q@H zal=g6Ipe`siZN4NZiBrkJCU*x216gmbV(FymgHuG@%%|8sgD?gR&0*{y4n=pukZnd z4=Nl~_>jVfbIehu)pG)WvuUpLR}~OKlW|)=S738Wh^a&L+Vx~KJU25o6%G7+Cy5mB zgmYsgkBC|@K4Jm_PwPoz`_|5QSk}^p`XV`649#jr4Lh^Q>Ne~#6Cqxn$7dNMF=%Va z%z9Ef6QmfoXAlQ3)PF8#3Y% zadcE<1`fd1&Q9fMZZnyI;&L;YPuy#TQ8b>AnXr*SGY&xUb>2678A+Y z8K%HOdgq_4LRFu_M>Ou|kj4W%sPPaV)#zDzN~25klE!!PFz_>5wCxglj7WZI13U5| zEq_YLKPH;v8sEhyG`dV_jozR);a6dBvkauhC;1dk%mr+J*Z6MMH9jqxFk@)&h{mHl zrf^i_d-#mTF=6-T8Rk?(1+rPGgl$9=j%#dkf@x6>czSc`jk7$f!9SrV{do%m!t8{? z_iAi$Qe&GDR#Nz^#uJ>-_?(E$ns)(3)X3cYY)?gFvU+N>nnCoBSmwB2<4L|xH19+4 z`$u#*Gt%mRw=*&|em}h_Y`Pzno?k^8e*hEwfM`A_yz-#vJtUfkGb=s>-!6cHfR$Mz z`*A8jVcz7T{n8M>ZTb_sl{EZ9Ctau4naX7TX?&g^VLE?wZ+}m)=YW4ODRy*lV4%-0 zG1XrPs($mVVfpnqoSihnIFkLdxG9um&n-U|`47l{bnr(|8dmglO7H~yeK7-wDwZXq zaHT($Qy2=MMuj@lir(iyxI1HnMlaJwpX86je}e=2n|Esb6hB?SmtDH3 z2qH6o`33b{;M{mDa5@@~1or8+Zcio*97pi1Jkx6v5MXCaYsb~Ynq)eWpKnF{n)FXZ z?Xd;o7ESu&rtMFr5(yJ(B7V>&0gnDdL*4MZH&eO+r*t!TR98ssbMRaw`7;`SLI8mT z=)hSAt~F=mz;JbDI6g~J%w!;QI(X14AnOu;uve^4wyaP3>(?jSLp+LQ7uU(iib%IyB(d&g@+hg;78M>h7yAeq$ALRoHGkKXA+E z$Sk-hd$Fs2nL4w9p@O*Y$c;U)W#d~)&8Js;i^Dp^* z0*7*zEGj~VehF4sRqSGny*K_CxeF=T^8;^lb}HF125G{kMRV?+hYktZWfNA^Mp7y8 zK~Q?ycf%rr+wgLaHQ|_<6z^eTG7izr@99SG9Q{$PCjJabSz`6L_QJJe7{LzTc$P&pwTy<&3RRUlSHmK;?}=QAhQaDW3#VWcNAH3 zeBPRTDf3?3mfdI$&WOg(nr9Gyzg`&u^o!f2rKJ57D_>p z6|?Vg?h(@(*X=o071{g^le>*>qSbVam`o}sAK8>b|11%e&;%`~b2OP7--q%0^2YDS z`2M`{2QYr1VC)sIW9WOu8<~7Q>^$*Og{KF+kI;wFegvaIDkB%3*%PWtWKSq7l`1YcDxQQ2@nv{J!xWV?G+w6C zhUUxUYVf%(Q(40_xrZB@rbxL=Dj3RV^{*yHd>4n-TOoHVRnazDOxxkS9kiZyN}IN3 zB^5N=* zRSTO+rA<{*P8-$GZdyUNOB=MzddG$*@q>mM;pUIiQ_z)hbE#Ze-IS)9G}Rt$5PSB{ zZZ;#h9nS7Rf1ecW&n(Gpu9}{vXQZ-f`UHIvD?cTbF`YvH*{rgE(zE22pLAQfhg-`U zuh612EpByB(~{w7svCylrBk%5$LCIyuhrGi=yOfca`=8ltKxHcSNfDRt@62QH^R_0 z&eQL6rRk>Dvf6rjMQv5ZXzg}S`HqV69hJT^pPHtdhqsrPJWs|IT9>BvpQa@*(FX6v zG}TYjreQCnH(slMt5{NgUf)qsS1F&Bb(M>$X}tWI&yt2I&-rJbqveuj?5J$`Dyfa2 z)m6Mq0XH@K)Y2v8X=-_4=4niodT&Y7W?$KLQhjA<+R}WTdYjX9>kD+SRS^oOY1{A= zZTId-(@wF^UEWso($wZtrs%e7t<}YaC_;#@`r0LUzKY&|qPJz*y~RHG`E6bypP5AX zN!p0^AUu8uDR>xM-ALFzBxXM~Q3z=}fHWCIG>0&I6x2Iu7&U)49j7qeMI&?qb$=4I zdMmhAJrO%@0f%YW! z^gLByEGSk+R0v4*d4w*N$Ju6z#j%HBI}6y$2en=-@S3=6+yZX94m&1j@s- z7T6|#0$c~dYq9IkA!P)AGkp~S$zYJ1SXZ#RM0|E~Q0PSm?DsT4N3f^)b#h(u9%_V5 zX*&EIX|gD~P!vtx?ra71pl%v)F!W~X2hcE!h8cu@6uKURdmo1-7icN4)ej4H1N~-C zjXgOK+mi#aJv4;`DZ%QUbVVZclkx;9`2kgbAhL^d{@etnm+5N8pB#fyH)bxtZGCAv z(%t0kPgBS{Q2HtjrfI0B$$M0c?{r~2T=zeXo7V&&aprCzww=i*}Atu7g^(*ivauMz~kkB%Vt{Wydlz%%2c26%>0PAbZO zVHx%tK(uzDl#ZZK`cW8TD2)eD77wB@gum{B2bO_jnqGl~01EF_^jx4Uqu1yfA~*&g zXJ`-N?D-n~5_QNF_5+Un-4&l$1b zVlHFqtluoN85b^C{A==lp#hS9J(npJ#6P4aY41r) zzCmv~c77X5L}H%sj>5t&@0heUDy;S1gSOS>JtH1v-k5l}z2h~i3^4NF6&iMb;ZYVE zMw*0%-9GdbpF1?HHim|4+)Zed=Fk<2Uz~GKc^P(Ig@x0&XuX0<-K(gA*KkN&lY2Xu zG054Q8wbK~$jE32#Ba*Id2vkqmfV{U$Nx9vJ;jeI`X+j1kh7hB8$CBTe@ANmT^tI8 z%U>zrTKuECin-M|B*gy(SPd`(_xvxjUL?s137KOyH>U{z01cBcFFt=Fp%d+BK4U;9 zQG_W5i)JASNpK)Q0wQpL<+Ml#cei41kCHe&P9?>p+KJN>I~`I^vK1h`IKB7k^xi`f z$H_mtr_+@M>C5+_xt%v}{#WO{86J83;VS@Ei3JLtp<*+hsY1oGzo z0?$?OJO$79;{|@aP!fO6t9TJ!?8i&|c&UPWRMbkwT3nEeFH`Yyyh6b%Rm^nBuTt@9 z+$&-4lf!G|@LCo3<8=yN@5dYbc%uq|Hz|0tiiLQKiUoM9g14zyECKGv0}3AWv2WJ zUAXGUhvkNk`0-H%ACsRSmy4fJ@kxBD3ZKSj6g(n1KPw?g{v19phcBr3BEF>J%lL|d zud3LNuL;cR*xS+;X+N^Br+x2{&hDMhb-$6_fKU(Pt0FQUXgNrZvzsVCnsFqv?#L z4-FYsQ-?D>;LdjHu_TT1CHN~aGkmDjWJkJg4G^!+V_APd%_48tErDv6BW5;ji^UDD zRu5Sw7wwplk`w{OGEKWJM&61c-AWn!SeUP8G#+beH4_Ov*)NUV?eGw&GHNDI6G(1Y zTfCv?T*@{QyK|!Q09wbk5koPD>=@(cA<~i4pSO?f(^5sSbdhUc+K$DW#_7^d7i%At z?KBg#vm$?P4h%?T=XymU;w*AsO_tJr)`+HUll+Uk_zx6vNw>G3jT){w3ck+Z=>7f0 zZVkM*!k^Z_E@_pZK6uH#|vzoL{-j1VFlUHP&5~q?j=UvJJNQG ztQdiCF$8_EaN_Pu8+afN6n8?m5UeR_p_6Log$5V(n9^W)-_vS~Ws`RJhQNPb1$C?| zd9D_ePe*`aI9AZ~Ltbg)DZ;JUo@-tu*O7CJ=T)ZI1&tn%#cisS85EaSvpS~c#CN9B z#Bx$vw|E@gm{;cJOuDi3F1#fxWZ9+5JCqVRCz5o`EDW890NUfNCuBn)3!&vFQE{E$L`Cf7FMSSX%ppLH+Z}#=p zSow$)$z3IL7frW#M>Z4|^9T!=Z8}B0h*MrWXXiVschEA=$a|yX9T~o!=%C?T+l^Cc zJx&MB$me(a*@lLLWZ=>PhKs!}#!ICa0! zq%jNgnF$>zrBZ3z%)Y*yOqHbKzEe_P=@<5$u^!~9G2OAzi#}oP&UL9JljG!zf{JIK z++G*8j)K=$#57N)hj_gSA8golO7xZP|KM?elUq)qLS)i(?&lk{oGMJh{^*FgklBY@Xfl<_Q zXP~(}ST6V01$~VfOmD6j!Hi}lsE}GQikW1YmBH)`f_+)KI!t#~B7=V;{F*`umxy#2Wt8(EbQ~ks9wZS(KV5#5Tn3Ia90r{}fI%pfbqBAG zhZ)E7)ZzqA672%@izC5sBpo>dCcpXi$VNFztSQnmI&u`@zQ#bqFd9d&ls?RomgbSh z9a2rjfNiKl2bR!$Y1B*?3Ko@s^L5lQN|i6ZtiZL|w5oq%{Fb@@E*2%%j=bcma{K~9 z*g1%nEZ;0g;S84ZZ$+Rfurh;Nhq0;{t~(EIRt}D@(Jb7fbe+_@H=t&)I)gPCtj*xI z9S>k?WEAWBmJZ|gs}#{3*pR`-`!HJ)1Dkx8vAM6Tv1bHZhH=MLI;iC#Y!$c|$*R>h zjP{ETat(izXB{@tTOAC4nWNhh1_%7AVaf!kVI5D=Jf5I1!?}stbx_Yv23hLf$iUTb z-)WrTtd2X+;vBW_q*Z6}B!10fs=2FA=3gy*dljsE43!G*3Uw(Is>(-a*5E!T4}b-Y zfvOC)-HYjNfcpi`=kG%(X3XcP?;p&=pz+F^6LKqRom~pA}O* zitR+Np{QZ(D2~p_Jh-k|dL!LPmexLM?tEqI^qRDq9Mg z5XBftj3z}dFir4oScbB&{m5>s{v&U=&_trq#7i&yQN}Z~OIu0}G)>RU*`4<}@7bB% zKYxGx0#L#u199YKSWZwV$nZd>D>{mDTs4qDNyi$4QT6z~D_%Bgf?>3L#NTtvX;?2D zS3IT*2i$Snp4fjDzR#<)A``4|dA(}wv^=L?rB!;kiotwU_gma`w+@AUtkSyhwp{M} z!e`jbUR3AG4XvnBVcyIZht6Vi~?pCC!$XF2 z*V~)DBVm8H7$*OZQJYl3482hadhsI2NCz~_NINtpC?|KI6H3`SG@1d%PsDdw{u}hq zN;OU~F7L1jT&KAitilb&Fl3X12zfSuFm;X)xQWOHL&7d)Q5wgn{78QJ6k5J;is+XP zCPO8_rlGMJB-kuQ*_=Yo1TswG4xnZd&eTjc8=-$6J^8TAa~kEnRQ@Zp-_W&B(4r@F zA==}0vBzsF1mB~743XqBmL9=0RSkGn$cvHf*hyc{<2{@hW+jKjbC|y%CNupHY_NC% zivz^btBLP-cDyV8j>u)=loBs>HoI5ME)xg)oK-Q0wAy|8WD$fm>K{-`0|W{H00;;G z000j`0OWQ8aHA9e04^;603eeQIvtaXMG=2tcr1y8Fl-J;AS+=<0%DU8Bp3oEEDhA^ zOY)M8%o5+cF$rC?trfMcty*f)R;^v=f~}||Xe!#;T3eTDZELN&-50xk+J1heP5AQ>h5O#S_uO;O@;~REd*_G$x$hVeE#bchX)otXQy|S5(oB)2a2%Sc(iDHm z=d>V|a!BLp9^#)o7^EQ2kg=K4%nI^sK2w@-kmvB+ARXYdq?xC2age6)e4$^UaY=wn zgLD^{X0A+{ySY+&7RpldwpC6=E zSPq?y(rl8ZN%(A*sapd4PU+dIakIwT0=zxIJEUW0kZSo|(zFEWdETY*ZjIk9uNMUA ze11=mHu8lUUlgRx!hItf0dAF#HfdIB+#aOuY--#QN9Ry zbx|XkG?PrBb@l6Owl{9Oa9w{x^R}%GwcEEfY;L-6OU8|9RXvu`-ECS`jcO1x1MP{P zcr;Bw##*Dod9K@pEx9z9G~MiNi>8v1OU-}vk*HbI)@CM? zn~b=jWUF%HP=CS+VCP>GiAU_UOz$aq3%%Z2laq^Gx`WAEmuNScCN)OlW>YHGYFgV2 z42lO5ZANs5VMXLS-RZTvBJkWy*OeV#L;7HwWg51*E|RpFR=H}h(|N+79g)tIW!RBK ze08bg^hlygY$C2`%N>7bDm`UZ(5M~DTanh3d~dg+OcNdUanr8azO?})g}EfnUB;5- zE1FX=ru?X=zAk4_6@__o1fE+ml1r&u^f1Kb24Jf-)zKla%-dbd>UZ1 zrj3!RR!Jg`ZnllKJ)4Yfg)@z>(fFepeOcp=F-^VHv?3jSxfa}-NB~*qkJ5Uq(yn+( z<8)qbZh{C!xnO@-XC~XMNVnr-Z+paowv!$H7>`ypMwA(X4(knx7z{UcWWe-wXM!d? zYT}xaVy|7T@yCbNOoy)$D=E%hUNTm(lPZqL)?$v+-~^-1P8m@Jm2t^L%4#!JK#Vtg zyUjM+Y*!$);1<)0MUqL00L0*EZcsE&usAK-?|{l|-)b7|PBKl}?TM6~#j9F+eZq25_L&oSl}DOMv^-tacpDI)l*Ws3u+~jO@;t(T)P=HCEZ#s_5q=m zOsVY!QsOJn)&+Ge6Tm)Ww_Bd@0PY(78ZJ)7_eP-cnXYk`>j9q`x2?Xc6O@55wF+6R zUPdIX!2{VGA;FSivN@+;GNZ7H2(pTDnAOKqF*ARg+C54vZ@Ve`i?%nDDvQRh?m&`1 zq46gH)wV=;UrwfCT3F(m!Q5qYpa!#f6qr0wF=5b9rk%HF(ITc!*R3wIFaCcftGwPt z(kzx{$*>g5L<;u}HzS4XD%ml zmdStbJcY@pn`!fUmkzJ8N>*8Y+DOO^r}1f4ix-`?x|khoRvF%jiA)8)P{?$8j2_qN zcl3Lm9-s$xdYN9)>3j6BPFK)Jbovl|Sf_p((CHe!4hx@F)hd&&*Xb&{TBj>%pT;-n z{3+hA^QZYnjXxtF2XwxPZ`S#J8h>5qLwtwM-{5abbEnRS z`9_`Zq8FJiI#0syE_V_3M&trw$P=ezkHosV$8&I5c0(*-9KBE5DJOC-Xv zw}1bq~AD0_Xerm`%ryiG9_$S z5G|btfiAUNdV09SO2l9v+e#(H6HYOdQs=^ z@xwZQU)~;p1L*~ciC}9ao{nQ-@B>rpUzKBxv=cUusOP5Trs3QnvHxGh9e>s7AM{V1|HfYe z3QwH;nHHR49fYzuGc3W3l5xrDAI392SFXx>lWE3V9Ds9il3PyZaN5>oC3>9W-^7vC z3~KZ-@iD?tIkhg+6t{m;RGk2%>@I0&kf)o$+-^ls0(YABNbM(=l#ad@nKp_j=b~Xs ziR;xu_+)lxy6|+af!@}gO2H_x)p;nZ-tYxW5Omq=l`GzMp*GTLr>vZN1?e}^C$t*Z zvzEdIc2|HA2RFN_4#EkzMqKnbbw!?!?%B@M0^^5Z;K?x-%lg?Z>}wMV8zEqHZ$cr~Y#Wv>9+)KMUZatUqbRU8 z8t9qrek(H^C0Tuzq|cP2$WL7tzj+Dj5y^2SF1D154CnsB$xbz`$wV||n-cG%rsT$p z+3RHdadK(3-noj(2L#8c5lODg)V8pv(GEnNb@F>dEHQr>!qge@L>#qg)RAUtiOYqF ziiV_ETExwD)bQ<))?-9$)E(FiRBYyC@}issHS!j9n)~I1tarxnQ2LfjdIJ)*jp{0E z&1oTd%!Qbw$W58s!6ms>F z=p0!~_Mv~8jyaicOS*t(ntw`5uFi0Bc4*mH8kSkk$>!f0;FM zX_t14I55!ZVsg0O$D2iuEDb7(J>5|NKW^Z~kzm@dax z9(|As$U7^}LF%#`6r&UPB*6`!Rf74h~*C=ami6xUxYCwiJxdr$+`z zKSC4A%8!s%R&j*2si(OEc*fy!q)?%=TjDZJ2}O zxT6o>jlKXz_7_Y$N})}IG`*#KfMzs#R(SI#)3*ZEzCv%_tu(VTZ5J| zw2$5kK)xTa>xGFgS0?X(NecjzFVKG%VVn?neu=&eQ+DJ1APlY1E?Q1s!Kk=yf7Uho z>8mg_!U{cKqpvI3ucSkC2V`!d^XMDk;>GG~>6>&X_z75-kv0UjevS5ORHV^e8r{tr z-9z*y&0eq3k-&c_AKw~<`8dtjsP0XgFv6AnG?0eo5P14T{xW#b*Hn2gEnt5-KvN1z zy!TUSi>IRbD3u+h@;fn7fy{F&hAKx7dG4i!c?5_GnvYV|_d&F16p;)pzEjB{zL-zr z(0&AZUkQ!(A>ghC5U-)t7(EXb-3)tNgb=z`>8m8n+N?vtl-1i&*ftMbE~0zsKG^I$ zSbh+rUiucsb!Ax@yB}j>yGeiKIZk1Xj!i#K^I*LZW_bWQIA-}FmJ~^}>p=K$bX9F{}z{s^KWc~OK(zl_X57aB^J9v}yQ5h#BE$+C)WOglV)nd0WWtaF{7`_Ur`my>4*NleQG#xae4fIo(b zW(&|g*#YHZNvDtE|6}yHvu(hDekJ-t*f!2RK;FZHRMb*l@Qwkh*~CqQRNLaepXypX z1?%ATf_nHIu3z6gK<7Dmd;{`0a!|toT0ck|TL$U;7Wr-*piO@R)KrbUz8SXO0vr1K z>76arfrqImq!ny+VkH!4?x*IR$d6*;ZA}Mhro(mzUa?agrFZpHi*)P~4~4N;XoIvH z9N%4VK|j4mV2DRQUD!_-9fmfA2(YVYyL#S$B;vqu7fnTbAFMqH``wS7^B5=|1O&fL z)qq(oV6_u4x(I(**#mD}MnAy(C&B4a1n6V%$&=vrIDq^F_KhE5Uw8_@{V`_#M0vCu zaNUXB=n0HT@D+ppDXi8-vp{tj)?7+k>1j}VvEKRgQ~DWva}8*pp`W8~KRo*kJ*&X} zP!~2fxQr@dM*q0dI|)Fux=pZWBk==RI7i{^BQf`kWlD2%|@R9!JA7& zLbM$uJ12y}_62$|T|{)@OJZtzfpL^t@1nMTYHutrF#D+^?~CN~9`YQ@#&&@c_Zf)( zbC~y8!2LO8jHwQXv>G~1q?c68ipT*%dY&c{8wd_!Y#~tMJ7yk!F8| zt?m_CLVw6cU@@p(#h4cY&Qsfz2Xp3w^4Cg%m03Tmq~9n%hyoMH^KY7{(QkRyn_!YB zzZa!Tgr~5$MAG$x)Fs71#6j}Kvcv3=9VUX8CH< zbP3|fY8f#$K*<5JQ7whM(v=GN2k26Xsh)#0!HKS(koLgAp-;)8z0w&_Z=nG4v6n8u z&Tm0Fi){4_!Y5Kp?!zv$FKfUifQ{%c82uYfrvE{%ejUd72aNYmI*0z3-a-EYr+bB->oH3#t(AY3 zV{Z=(SJr;D#0(`u*dc*~9T7D8Pudw894%!>c4wU&V1m<~0InidR6fbi?yPl(z+sKa zdF*kS>_4^1UO>y4T%Ar>epSr5&vp`$KdY7B(F%P0@VyHk@1fJ=6X0=aGjD-)BrOJD zW}IU@hg~^2r>a1fQvjTtvL*mKJ7q;pfP*U2=URL`VB_Y_JojbZ+MS=vaVN0C6L_MV zG1#5=35-E`KsD%r>-Q_ndvJ2tOYcMMP9f*t0iJ`(Z`^+YP)h>@lR(@Wvrt-`0tHG+ zuP2R@@mx=T@fPoQ1s`e^1I0H*kQPBGDky@!ZQG@8jY-+2ihreG5q$6i{3vmDTg0j$ zzRb*-nKN@{_wD`V6+i*YS)?$XfrA-sW?js?SYU8#vXxxQCc|*K!EbpWfu)3~jwq6_@KC0m;3A%jH^18_a0;ksC2DEwa@2{9@{ z9@T??<4QwR69zk{UvcHHX;`ICOwrF;@U;etd@YE)4MzI1WCsadP=`%^B>xPS-{`=~ zZ+2im8meb#4p~XIL9}ZOBg7D8R=PC8V}ObDcxEEK(4yGKcyCQWUe{9jCs+@k!_y|I z%s{W(&>P4w@hjQ>PQL$zY+=&aDU6cWr#hG)BVCyfP)h>@3IG5I2mk;8K>)Ppba*!h z005B=001VF5fT=Y4_ytCUk`sv8hJckqSy&Gc2Jx^WJ$J~08N{il-M$fz_ML$)Cpil z(nOv_nlZB^c4s&&O3h=OLiCz&(|f0 zxWU_-JZy>hxP*gvR>CLnNeQ1~g;6{g#-}AbkIzWR;j=8=6!AHpKQCbjFYxf9h%bov zVi;eNa1>t-<14KERUW>^KwoF+8zNo`Y*WiQwq}3m0_2RYtL9Wmu`JaRaQMQ)`Si^6+VbM`!rH~T?DX2=(n4nT zf`G`(Rpq*pDk*v~wMYPZ@vMNZDMPnxMYmU!lA{Xfo?n=Ibb4y3eyY1@Dut4|Y^ml& zqs$r}jAo=B(Ml>ogeEjyv(E`=kBzPf2uv9TQtO$~bamD#=Tv`lNy(K|w$J2O6jS51 zzZtOCHDWz7W0=L1XDW5WR5mtLGc~W+>*vX5{e~U@rE~?7e>vKU-v8bj;F4#abtcV(3ZtwXo9ia93HiETyQXwW4a-0){;$OU*l` zW^bjkyZTJ6_DL^0}`*)#EZ|2nvKRzMLH9-~@Z6$v#t8Dm%(qpP+DgzNe6d)1q zBqhyF$jJTyYFvl_=a>#I8jhJ)d6SBNPg#xg2^kZ3NX8kQ74ah(Y5Z8mlXyzTD&}Q8 ziY(pj-N-V2f>&hZQJ`Di%wp2fN(I%F@l)3M8GcSdNy+#HuO{$I8NXubRlFkL)cY@b z#`v{}-^hRXEq*8B_cG=%PZvI$eo(|8Wc(2o8L#0_GX9L$1@yV>%7mGk)QTD1R*OvS z4OW;ym1)%k9Bfem0tOqq3yyAUWp&q|LsN!RDnxa|j;>R|Mm2rIv7=tej5GFaa+`#| z;7u9Z_^XV+vD@2hF8Xe63+Qd`oig6S9jX(*DbjzPb*K-H7c^7E-(~!R6E%TrgW;RvG;WS{Ziv*W*a*`9Bb;$Er3?MyF~5GcXv`k>U)n}lwv$Sp+H@IKA5$mKk0g*4Ln{!tfvITeY zzr%8JJ5BdcEYsR9eGzJ4B&$}4FMmbRU6{8{_w7Kl77@PNe7|Bc#c?5(C5&Z=kJ#(oM90D4`rh2S!|^L!P#e#1hkD5@~-- z`63GV0~*rOZSqw7k^#-Y$Q4z3Oa2SPRURqEahB1B^h{7~+p03SwzqL9QU#$3-X zdYtQ?-K5xDAdfomEd6(yPtZ!yY_<35bMedeq`z2JWorljz5-f9<^93HM-$#+acw%9r!JOM%O<|BR`W& zd-%j_?b^q7Kl6{q^N{cg2u;11rFB5EP+oqG9&pHD#_Mo@aNMj;LUvsl&nK(ca(hT( zzFc2oHC6WQv8g7jo+3ZSwK+9G$cvfRnql)?g=XeQ3+LTh3)79nhEle8OqS3T$qn(> z(=5Bg?EWq-ldEywgzXW965%H(9^ik*rH(8dNdkbcS9|ow&_r`X~R^R?B+(oTiMzzlx8KnHqUi z8Rh-)VAnS-CO+3}yxqm8)X+N+uzieFVm-F#syP#M1p5&$wX3MJ8 z+R@grZ*5G^Uh4I@VT=>C4RJNc^~3mx$kS1F{L?3)BzdduD2MZKdu#jNno&f2&d{?` zW(>$oktzY@GO{|Ln~Bt^A4)(%?l-&(Dm!iL#$K_xOyhwAf=K2<+Bom zw7|hl6E5}B$d%n0sfZvfQRy9Fyz2~ z83#=#LaHnf1th^k*p|ux8!!8pfHE!)x*%=_hAddl)P%4h4%&8!5-W#xqqb}c=H(i|wqcIS&oDQ{ zhI7N-$f$ra3=RjPmMh?-IEkJYQ<}R9Z!}wmp$#~Uc%u1oh#TP}wF*kJJmQX2#27kL z_dz(yKufo<=m71bZfLp^Ll#t3(IHkrgMcvx@~om%Ib(h(<$Da7urTI`x|%`wD--sN zJEEa>4DGSEG?0ulkosfj8IMNN4)B=ZtvGG{|4Fp=Xhg!wPNgYzS>{Bp%%Qa+624X@ X49Luk)baa85H9$5YCsTPT`SVRWMtMW diff --git a/clients/java/v1/gradle/wrapper/gradle-wrapper.properties b/clients/java/v1/gradle/wrapper/gradle-wrapper.properties index 4d9ca164..ffed3a25 100644 --- a/clients/java/v1/gradle/wrapper/gradle-wrapper.properties +++ b/clients/java/v1/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/clients/java/v1/gradlew b/clients/java/v1/gradlew index 4f906e0c..005bcde0 100644 --- a/clients/java/v1/gradlew +++ b/clients/java/v1/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/clients/java/v1/gradlew.bat b/clients/java/v1/gradlew.bat index 107acd32..6a68175e 100644 --- a/clients/java/v1/gradlew.bat +++ b/clients/java/v1/gradlew.bat @@ -33,7 +33,7 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/clients/java/v1/pom.xml b/clients/java/v1/pom.xml index a5eb678b..50b16bcf 100644 --- a/clients/java/v1/pom.xml +++ b/clients/java/v1/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.0.0 enforce-maven @@ -70,7 +70,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M4 + 3.0.0-M5 @@ -97,16 +97,14 @@ - org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.2.0 - jar test-jar @@ -114,11 +112,10 @@ - org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.2.0 add_sources @@ -149,7 +146,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 attach-javadocs @@ -172,7 +169,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.0 attach-sources @@ -182,6 +179,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -193,7 +232,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -247,36 +286,56 @@ ${commons-lang3-version} - org.threeten - threetenbp - ${threetenbp-version} + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided - javax.annotation - javax.annotation-api - ${javax-annotation-version} - provided + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test + + org.mockito + mockito-core + ${mockito-core-version} + test + - 1.7 + 1.8 ${java.version} ${java.version} 1.8.5 - 1.6.2 - 4.9.1 - 2.8.6 - 3.11 - 1.5.0 - 1.3.2 - 4.13.1 + 1.6.5 + 4.9.3 + 2.9.0 + 3.12.0 + 0.2.2 + 1.3.5 + 5.8.2 + 3.12.4 + 2.1.1 + 1.1.1 UTF-8 + 2.21.0 diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/ApiCallback.java b/clients/java/v1/src/main/java/io/nomadproject/client/ApiCallback.java index 5cbbdd7a..0006b0be 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/ApiCallback.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/ApiCallback.java @@ -52,10 +52,10 @@ public interface ApiCallback { void onUploadProgress(long bytesWritten, long contentLength, boolean done); /** - * This is called when the API downlond processing. + * This is called when the API download processing. * * @param bytesRead bytes Read - * @param contentLength content lenngth of the response + * @param contentLength content length of the response * @param done Read end */ void onDownloadProgress(long bytesRead, long contentLength, boolean done); diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/ApiClient.java b/clients/java/v1/src/main/java/io/nomadproject/client/ApiClient.java index 30a8f5e7..81ed5525 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/ApiClient.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/ApiClient.java @@ -18,11 +18,9 @@ import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; import okio.BufferedSink; import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import javax.net.ssl.*; import java.io.File; @@ -43,6 +41,9 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; @@ -54,6 +55,9 @@ import io.nomadproject.client.auth.HttpBearerAuth; import io.nomadproject.client.auth.ApiKeyAuth; +/** + *

ApiClient class.

+ */ public class ApiClient { private String basePath = "https://127.0.0.1:4646/v1"; @@ -78,7 +82,7 @@ public class ApiClient { private HttpLoggingInterceptor loggingInterceptor; - /* + /** * Basic constructor for ApiClient */ public ApiClient() { @@ -91,8 +95,10 @@ public ApiClient() { authentications = Collections.unmodifiableMap(authentications); } - /* + /** * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object */ public ApiClient(OkHttpClient client) { init(); @@ -164,7 +170,7 @@ public OkHttpClient getHttpClient() { * * @param newHttpClient An instance of OkHttpClient * @return Api Client - * @throws NullPointerException when newHttpClient is null + * @throws java.lang.NullPointerException when newHttpClient is null */ public ApiClient setHttpClient(OkHttpClient newHttpClient) { this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); @@ -236,6 +242,11 @@ public ApiClient setSslCaCert(InputStream sslCaCert) { return this; } + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ public KeyManager[] getKeyManagers() { return keyManagers; } @@ -253,30 +264,65 @@ public ApiClient setKeyManagers(KeyManager[] managers) { return this; } + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ public DateFormat getDateFormat() { return dateFormat; } + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link io.nomadproject.client.ApiClient} object + */ public ApiClient setDateFormat(DateFormat dateFormat) { this.json.setDateFormat(dateFormat); return this; } + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link io.nomadproject.client.ApiClient} object + */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { this.json.setSqlDateFormat(dateFormat); return this; } + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link io.nomadproject.client.ApiClient} object + */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; } + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link io.nomadproject.client.ApiClient} object + */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { this.json.setLocalDateFormat(dateFormat); return this; } + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link io.nomadproject.client.ApiClient} object + */ public ApiClient setLenientOnJson(boolean lenientOnJson) { this.json.setLenientOnJson(lenientOnJson); return this; @@ -441,7 +487,7 @@ public ApiClient setDebugging(boolean debugging) { /** * The path of temporary folder used to store downloaded files from endpoints * with file response. The default value is null, i.e. using - * the system's default tempopary folder. + * the system's default temporary folder. * * @see
createTempFile * @return Temporary folder path @@ -473,7 +519,7 @@ public int getConnectTimeout() { /** * Sets the connect timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. + * {@link java.lang.Integer#MAX_VALUE}. * * @param connectionTimeout connection timeout in milliseconds * @return Api client @@ -495,7 +541,7 @@ public int getReadTimeout() { /** * Sets the read timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. + * {@link java.lang.Integer#MAX_VALUE}. * * @param readTimeout read timeout in milliseconds * @return Api client @@ -517,7 +563,7 @@ public int getWriteTimeout() { /** * Sets the write timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. + * {@link java.lang.Integer#MAX_VALUE}. * * @param writeTimeout connection timeout in milliseconds * @return Api client @@ -715,17 +761,23 @@ public String selectHeaderAccept(String[] accepts) { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * returns null. If it matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { return "application/json"; } + for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } + return contentTypes[0]; } @@ -751,7 +803,7 @@ public String escapeString(String str) { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * @throws io.nomadproject.client.ApiException If fail to deserialize response body, i.e. cannot read response body * or the Content-Type of the response is not supported. */ @SuppressWarnings("unchecked") @@ -812,7 +864,7 @@ public T deserialize(Response response, Type returnType) throws ApiException * @param obj The Java object * @param contentType The request Content-Type * @return The serialized request body - * @throws ApiException If fail to serialize the given object + * @throws io.nomadproject.client.ApiException If fail to serialize the given object */ public RequestBody serialize(Object obj, String contentType) throws ApiException { if (obj instanceof byte[]) { @@ -821,6 +873,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { @@ -838,7 +892,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException * Download file from the given response. * * @param response An instance of the Response object - * @throws ApiException If fail to read file content from response and write to disk + * @throws io.nomadproject.client.ApiException If fail to read file content from response and write to disk * @return Downloaded file */ public File downloadFileFromResponse(Response response) throws ApiException { @@ -858,7 +912,7 @@ public File downloadFileFromResponse(Response response) throws ApiException { * * @param response An instance of the Response object * @return Prepared file for the download - * @throws IOException If fail to prepare file for download + * @throws java.io.IOException If fail to prepare file for download */ public File prepareDownloadFile(Response response) throws IOException { String filename = null; @@ -902,7 +956,7 @@ public File prepareDownloadFile(Response response) throws IOException { * @param Type * @param call An instance of the Call object * @return ApiResponse<T> - * @throws ApiException If fail to execute the call + * @throws io.nomadproject.client.ApiException If fail to execute the call */ public ApiResponse execute(Call call) throws ApiException { return execute(call, null); @@ -917,7 +971,7 @@ public ApiResponse execute(Call call) throws ApiException { * @return ApiResponse object containing response status, headers and * data, which is a Java object deserialized from response body and would be null * when returnType is null. - * @throws ApiException If fail to execute the call + * @throws io.nomadproject.client.ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -981,7 +1035,7 @@ public void onResponse(Call call, Response response) throws IOException { * @param response Response * @param returnType Return type * @return Type - * @throws ApiException If the response has an unsuccessful status code or + * @throws io.nomadproject.client.ApiException If the response has an unsuccessful status code or * fail to deserialize the response body */ public T handleResponse(Response response, Type returnType) throws ApiException { @@ -1016,6 +1070,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1027,10 +1082,10 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP call - * @throws ApiException If fail to serialize the request body object + * @throws io.nomadproject.client.ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -1038,6 +1093,7 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + // prepare HTTP request body RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; } else if ("application/x-www-form-urlencoded".equals(contentType)) { @@ -1078,12 +1130,19 @@ public Request buildRequest(String path, String method, List queryParams, reqBody = null; } else { // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); } } else { reqBody = serialize(body, contentType); } + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + // Associate callback with request (if not null) so interceptor can // access it when creating ProgressResponseBody reqBuilder.tag(callback); @@ -1103,14 +1162,19 @@ public Request buildRequest(String path, String method, List queryParams, /** * Build full URL by concatenating base path, the given sub path and query parameters. * + * @param baseUrl The base URL * @param path The sub path * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" @@ -1190,14 +1254,19 @@ public void processCookieParams(Map cookieParams, Request.Builde * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws io.nomadproject.client.ApiException If fails to update the parameters */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { throw new RuntimeException("Authentication undefined: " + authName); } - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } @@ -1227,9 +1296,14 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } + } } else { Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); @@ -1253,6 +1327,19 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. @@ -1349,4 +1436,26 @@ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityExcepti throw new AssertionError(e); } } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws io.nomadproject.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/ApiException.java b/clients/java/v1/src/main/java/io/nomadproject/client/ApiException.java index 966f3ef7..589e6136 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/ApiException.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/ApiException.java @@ -16,22 +16,50 @@ import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - + + /** + *

Constructor for ApiException.

+ */ public ApiException() {} + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ public ApiException(Throwable throwable) { super(throwable); } + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ public ApiException(String message) { super(message); } + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { super(message, throwable); this.code = code; @@ -39,23 +67,60 @@ public ApiException(String message, Throwable throwable, int code, MapConstructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ public ApiException(String message, int code, Map> responseHeaders, String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { this(message, throwable, code, responseHeaders, null); } + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ public ApiException(int code, Map> responseHeaders, String responseBody) { this((String) null, (Throwable) null, code, responseHeaders, responseBody); } + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ public ApiException(int code, String message) { super(message); this.code = code; } + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ public ApiException(int code, String message, Map> responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; @@ -88,4 +153,14 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders().toString()); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/ApiResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/ApiResponse.java index 94418ca5..9f39be9b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/ApiResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/ApiResponse.java @@ -18,8 +18,6 @@ /** * API response returned by API call. - * - * @param The type of data that is deserialized from response body */ public class ApiResponse { final private int statusCode; @@ -27,6 +25,8 @@ public class ApiResponse { final private T data; /** + *

Constructor for ApiResponse.

+ * * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response */ @@ -35,6 +35,8 @@ public ApiResponse(int statusCode, Map> headers) { } /** + *

Constructor for ApiResponse.

+ * * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response * @param data The object deserialized from response bod @@ -45,14 +47,29 @@ public ApiResponse(int statusCode, Map> headers, T data) { this.data = data; } + /** + *

Get the status code.

+ * + * @return the status code + */ public int getStatusCode() { return statusCode; } + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ public Map> getHeaders() { return headers; } + /** + *

Get the data.

+ * + * @return the data + */ public T getData() { return data; } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/JSON.java b/clients/java/v1/src/main/java/io/nomadproject/client/JSON.java index bfacce5b..45522457 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/JSON.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/JSON.java @@ -23,11 +23,7 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import io.nomadproject.client.models.*; import okio.ByteString; import java.io.IOException; @@ -36,19 +32,28 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; import java.util.HashMap; +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { @@ -81,13 +86,203 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ACLPolicy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ACLPolicyListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ACLToken.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ACLTokenListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Affinity.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocDeploymentStatus.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocStopResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocatedCpuResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocatedDeviceResource.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocatedMemoryResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocatedResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocatedSharedResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocatedTaskResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Allocation.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocationListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AllocationMetric.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Attribute.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.AutopilotConfiguration.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIControllerInfo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIInfo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIMountOptions.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSINodeInfo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIPlugin.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIPluginListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSISnapshot.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSISnapshotCreateRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSISnapshotCreateResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSISnapshotListResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSITopology.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSITopologyRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolume.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolumeCapability.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolumeCreateRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolumeExternalStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolumeListExternalResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolumeListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CSIVolumeRegisterRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.CheckRestart.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Constraint.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Consul.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulConnect.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulExposeConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulExposePath.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulGateway.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulGatewayBindAddress.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulGatewayProxy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulGatewayTLSConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulIngressConfigEntry.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulIngressListener.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulIngressService.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulLinkedService.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulMeshGateway.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulProxy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulSidecarService.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulTerminatingConfigEntry.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ConsulUpstream.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DNSConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Deployment.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DeploymentAllocHealthRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DeploymentPauseRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DeploymentPromoteRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DeploymentState.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DeploymentUnblockRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DeploymentUpdateResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DesiredTransition.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DesiredUpdates.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DispatchPayloadConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DrainMetadata.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DrainSpec.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DrainStrategy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.DriverInfo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.EphemeralDisk.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.EvalOptions.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Evaluation.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.EvaluationStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.FieldDiff.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.FuzzyMatch.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.FuzzySearchRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.FuzzySearchResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.GaugeValue.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.HostNetworkInfo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.HostVolumeInfo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Job.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobChildrenSummary.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobDeregisterResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobDiff.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobDispatchRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobDispatchResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobEvaluateRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobPlanRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobPlanResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobRegisterRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobRegisterResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobRevertRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobScaleStatusResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobStabilityRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobStabilityResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobSummary.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobValidateRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobValidateResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobVersionsResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.JobsParseRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.LogConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.MetricsSummary.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.MigrateStrategy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Multiregion.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.MultiregionRegion.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.MultiregionStrategy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Namespace.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NamespaceCapabilities.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NetworkResource.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Node.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeCpuResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeDevice.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeDeviceLocality.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeDeviceResource.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeDiskResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeDrainUpdateResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeEligibilityUpdateResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeMemoryResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodePurgeResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeReservedCpuResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeReservedDiskResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeReservedMemoryResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeReservedNetworkResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeReservedResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeResources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeScoreMeta.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeUpdateDrainRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.NodeUpdateEligibilityRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ObjectDiff.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.OneTimeToken.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.OneTimeTokenExchangeRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.OperatorHealthReply.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ParameterizedJobConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.PeriodicConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.PeriodicForceResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.PlanAnnotations.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.PointValue.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Port.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.PortMapping.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.PreemptionConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.QuotaLimit.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.QuotaSpec.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.RaftConfiguration.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.RaftServer.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.RequestedDevice.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.RescheduleEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ReschedulePolicy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.RescheduleTracker.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Resources.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.RestartPolicy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SampledValue.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ScalingEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ScalingPolicy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ScalingPolicyListStub.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ScalingRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SchedulerConfiguration.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SchedulerConfigurationResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SchedulerSetConfigurationResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SearchRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SearchResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ServerHealth.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Service.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ServiceCheck.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.ServiceRegistration.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SidecarTask.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Spread.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.SpreadTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Task.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskArtifact.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskCSIPluginConfig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskDiff.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskGroup.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskGroupDiff.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskGroupScaleStatus.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskGroupSummary.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskHandle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskLifecycle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.TaskState.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Template.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.UpdateStrategy.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.Vault.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.VolumeMount.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.VolumeRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new io.nomadproject.client.models.WaitConfig.CustomTypeAdapterFactory()) .create(); } @@ -96,7 +291,7 @@ public JSON() { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -104,16 +299,13 @@ public Gson getGson() { * Set Gson. * * @param gson Gson - * @return JSON */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; + public static void setGson(Gson gson) { + JSON.gson = gson; } - public JSON setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; - return this; } /** @@ -122,7 +314,7 @@ public JSON setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -135,7 +327,7 @@ public String serialize(Object obj) { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); @@ -159,7 +351,7 @@ public T deserialize(String body, Type returnType) { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -231,7 +423,7 @@ public OffsetDateTime read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -269,14 +461,12 @@ public LocalDate read(JsonReader in) throws IOException { } } - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); - return this; } /** @@ -390,14 +580,11 @@ public Date read(JsonReader in) throws IOException { } } - public JSON setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); - return this; } - } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/Pair.java b/clients/java/v1/src/main/java/io/nomadproject/client/Pair.java index 2b086dc7..d8449017 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/Pair.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/Pair.java @@ -52,10 +52,6 @@ private boolean isValidString(String arg) { return false; } - if (arg.trim().isEmpty()) { - return false; - } - return true; } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/ProgressResponseBody.java b/clients/java/v1/src/main/java/io/nomadproject/client/ProgressResponseBody.java index e3b5e5f3..3155e30c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/ProgressResponseBody.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/ProgressResponseBody.java @@ -68,5 +68,3 @@ public long read(Buffer sink, long byteCount) throws IOException { }; } } - - diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/ServerConfiguration.java b/clients/java/v1/src/main/java/io/nomadproject/client/ServerConfiguration.java index 5763ef2e..020fa001 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/ServerConfiguration.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/ServerConfiguration.java @@ -12,7 +12,7 @@ public class ServerConfiguration { /** * @param URL A URL to the target host. - * @param description A describtion of the host designated by the URL. + * @param description A description of the host designated by the URL. * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ public ServerConfiguration(String URL, String description, Map variables) { @@ -39,7 +39,7 @@ public String URL(Map variables) { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } url = url.replaceAll("\\{" + name + "\\}", value); diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/AclApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/AclApi.java index 1db8ef03..29356c00 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/AclApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/AclApi.java @@ -39,9 +39,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AclApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public AclApi() { this(Configuration.getDefaultApiClient()); @@ -59,6 +62,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for deleteACLPolicy * @param policyName The ACL policy name. (required) @@ -80,6 +99,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteACLPolicyCall(String policyName, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -120,10 +152,12 @@ public okhttp3.Call deleteACLPolicyCall(String policyName, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -236,6 +270,19 @@ public okhttp3.Call deleteACLPolicyAsync(String policyName, String region, Strin */ public okhttp3.Call deleteACLTokenCall(String tokenAccessor, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -276,10 +323,12 @@ public okhttp3.Call deleteACLTokenCall(String tokenAccessor, String region, Stri }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -396,6 +445,19 @@ public okhttp3.Call deleteACLTokenAsync(String tokenAccessor, String region, Str */ public okhttp3.Call getACLPoliciesCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -455,10 +517,12 @@ public okhttp3.Call getACLPoliciesCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -587,6 +651,19 @@ public okhttp3.Call getACLPoliciesAsync(String region, String namespace, Integer */ public okhttp3.Call getACLPolicyCall(String policyName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -647,10 +724,12 @@ public okhttp3.Call getACLPolicyCall(String policyName, String region, String na }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -787,6 +866,19 @@ public okhttp3.Call getACLPolicyAsync(String policyName, String region, String n */ public okhttp3.Call getACLTokenCall(String tokenAccessor, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -847,10 +939,12 @@ public okhttp3.Call getACLTokenCall(String tokenAccessor, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -986,6 +1080,19 @@ public okhttp3.Call getACLTokenAsync(String tokenAccessor, String region, String */ public okhttp3.Call getACLTokenSelfCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1045,10 +1152,12 @@ public okhttp3.Call getACLTokenSelfCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1176,6 +1285,19 @@ public okhttp3.Call getACLTokenSelfAsync(String region, String namespace, Intege */ public okhttp3.Call getACLTokensCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1235,10 +1357,12 @@ public okhttp3.Call getACLTokensCall(String region, String namespace, Integer in }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1361,6 +1485,19 @@ public okhttp3.Call getACLTokensAsync(String region, String namespace, Integer i */ public okhttp3.Call postACLBootstrapCall(String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1400,10 +1537,12 @@ public okhttp3.Call postACLBootstrapCall(String region, String namespace, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1513,6 +1652,19 @@ public okhttp3.Call postACLBootstrapAsync(String region, String namespace, Strin */ public okhttp3.Call postACLPolicyCall(String policyName, ACLPolicy acLPolicy, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = acLPolicy; // create path and map variables @@ -1553,10 +1705,12 @@ public okhttp3.Call postACLPolicyCall(String policyName, ACLPolicy acLPolicy, St "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1678,6 +1832,19 @@ public okhttp3.Call postACLPolicyAsync(String policyName, ACLPolicy acLPolicy, S */ public okhttp3.Call postACLTokenCall(String tokenAccessor, ACLToken acLToken, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = acLToken; // create path and map variables @@ -1718,10 +1885,12 @@ public okhttp3.Call postACLTokenCall(String tokenAccessor, ACLToken acLToken, St "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1845,6 +2014,19 @@ public okhttp3.Call postACLTokenAsync(String tokenAccessor, ACLToken acLToken, S */ public okhttp3.Call postACLTokenOnetimeCall(String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1884,10 +2066,12 @@ public okhttp3.Call postACLTokenOnetimeCall(String region, String namespace, Str }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1996,6 +2180,19 @@ public okhttp3.Call postACLTokenOnetimeAsync(String region, String namespace, St */ public okhttp3.Call postACLTokenOnetimeExchangeCall(OneTimeTokenExchangeRequest oneTimeTokenExchangeRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = oneTimeTokenExchangeRequest; // create path and map variables @@ -2035,10 +2232,12 @@ public okhttp3.Call postACLTokenOnetimeExchangeCall(OneTimeTokenExchangeRequest "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/AllocationsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/AllocationsApi.java index a96c9d24..5427717f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/AllocationsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/AllocationsApi.java @@ -37,9 +37,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AllocationsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public AllocationsApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +60,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getAllocation * @param allocID Allocation ID. (required) @@ -83,6 +102,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getAllocationCall(String allocID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -143,10 +175,12 @@ public okhttp3.Call getAllocationCall(String allocID, String region, String name }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -283,6 +317,19 @@ public okhttp3.Call getAllocationAsync(String allocID, String region, String nam */ public okhttp3.Call getAllocationServicesCall(String allocID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -343,10 +390,12 @@ public okhttp3.Call getAllocationServicesCall(String allocID, String region, Str }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -484,6 +533,19 @@ public okhttp3.Call getAllocationServicesAsync(String allocID, String region, St */ public okhttp3.Call getAllocationsCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, Boolean resources, Boolean taskStates, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -551,10 +613,12 @@ public okhttp3.Call getAllocationsCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -690,6 +754,19 @@ public okhttp3.Call getAllocationsAsync(String region, String namespace, Integer */ public okhttp3.Call postAllocationStopCall(String allocID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, Boolean noShutdownDelay, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -754,10 +831,12 @@ public okhttp3.Call postAllocationStopCall(String allocID, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/DeploymentsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/DeploymentsApi.java index 2be9c0ec..f181483b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/DeploymentsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/DeploymentsApi.java @@ -40,9 +40,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class DeploymentsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public DeploymentsApi() { this(Configuration.getDefaultApiClient()); @@ -60,6 +63,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getDeployment * @param deploymentID Deployment ID. (required) @@ -86,6 +105,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getDeploymentCall(String deploymentID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -146,10 +178,12 @@ public okhttp3.Call getDeploymentCall(String deploymentID, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -286,6 +320,19 @@ public okhttp3.Call getDeploymentAsync(String deploymentID, String region, Strin */ public okhttp3.Call getDeploymentAllocationsCall(String deploymentID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -346,10 +393,12 @@ public okhttp3.Call getDeploymentAllocationsCall(String deploymentID, String reg }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -485,6 +534,19 @@ public okhttp3.Call getDeploymentAllocationsAsync(String deploymentID, String re */ public okhttp3.Call getDeploymentsCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -544,10 +606,12 @@ public okhttp3.Call getDeploymentsCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -672,6 +736,19 @@ public okhttp3.Call getDeploymentsAsync(String region, String namespace, Integer */ public okhttp3.Call postDeploymentAllocationHealthCall(String deploymentID, DeploymentAllocHealthRequest deploymentAllocHealthRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = deploymentAllocHealthRequest; // create path and map variables @@ -712,10 +789,12 @@ public okhttp3.Call postDeploymentAllocationHealthCall(String deploymentID, Depl "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -840,6 +919,19 @@ public okhttp3.Call postDeploymentAllocationHealthAsync(String deploymentID, Dep */ public okhttp3.Call postDeploymentFailCall(String deploymentID, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -880,10 +972,12 @@ public okhttp3.Call postDeploymentFailCall(String deploymentID, String region, S }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1001,6 +1095,19 @@ public okhttp3.Call postDeploymentFailAsync(String deploymentID, String region, */ public okhttp3.Call postDeploymentPauseCall(String deploymentID, DeploymentPauseRequest deploymentPauseRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = deploymentPauseRequest; // create path and map variables @@ -1041,10 +1148,12 @@ public okhttp3.Call postDeploymentPauseCall(String deploymentID, DeploymentPause "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1170,6 +1279,19 @@ public okhttp3.Call postDeploymentPauseAsync(String deploymentID, DeploymentPaus */ public okhttp3.Call postDeploymentPromoteCall(String deploymentID, DeploymentPromoteRequest deploymentPromoteRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = deploymentPromoteRequest; // create path and map variables @@ -1210,10 +1332,12 @@ public okhttp3.Call postDeploymentPromoteCall(String deploymentID, DeploymentPro "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1339,6 +1463,19 @@ public okhttp3.Call postDeploymentPromoteAsync(String deploymentID, DeploymentPr */ public okhttp3.Call postDeploymentUnblockCall(String deploymentID, DeploymentUnblockRequest deploymentUnblockRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = deploymentUnblockRequest; // create path and map variables @@ -1379,10 +1516,12 @@ public okhttp3.Call postDeploymentUnblockCall(String deploymentID, DeploymentUnb "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/EnterpriseApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/EnterpriseApi.java index dc7bbd34..005dc995 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/EnterpriseApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/EnterpriseApi.java @@ -34,9 +34,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class EnterpriseApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public EnterpriseApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +57,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createQuotaSpec * @param quotaSpec (required) @@ -75,6 +94,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createQuotaSpecCall(QuotaSpec quotaSpec, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = quotaSpec; // create path and map variables @@ -114,10 +146,12 @@ public okhttp3.Call createQuotaSpecCall(QuotaSpec quotaSpec, String region, Stri "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -230,6 +264,19 @@ public okhttp3.Call createQuotaSpecAsync(QuotaSpec quotaSpec, String region, Str */ public okhttp3.Call deleteQuotaSpecCall(String specName, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -270,10 +317,12 @@ public okhttp3.Call deleteQuotaSpecCall(String specName, String region, String n }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -391,6 +440,19 @@ public okhttp3.Call deleteQuotaSpecAsync(String specName, String region, String */ public okhttp3.Call getQuotaSpecCall(String specName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -451,10 +513,12 @@ public okhttp3.Call getQuotaSpecCall(String specName, String region, String name }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -590,6 +654,19 @@ public okhttp3.Call getQuotaSpecAsync(String specName, String region, String nam */ public okhttp3.Call getQuotasCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -649,10 +726,12 @@ public okhttp3.Call getQuotasCall(String region, String namespace, Integer index }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -777,6 +856,19 @@ public okhttp3.Call getQuotasAsync(String region, String namespace, Integer inde */ public okhttp3.Call postQuotaSpecCall(String specName, QuotaSpec quotaSpec, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = quotaSpec; // create path and map variables @@ -817,10 +909,12 @@ public okhttp3.Call postQuotaSpecCall(String specName, QuotaSpec quotaSpec, Stri "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/EvaluationsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/EvaluationsApi.java index ed230bbc..848dfd30 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/EvaluationsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/EvaluationsApi.java @@ -35,9 +35,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class EvaluationsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public EvaluationsApi() { this(Configuration.getDefaultApiClient()); @@ -55,6 +58,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getEvaluation * @param evalID Evaluation ID. (required) @@ -81,6 +100,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getEvaluationCall(String evalID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -141,10 +173,12 @@ public okhttp3.Call getEvaluationCall(String evalID, String region, String names }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -281,6 +315,19 @@ public okhttp3.Call getEvaluationAsync(String evalID, String region, String name */ public okhttp3.Call getEvaluationAllocationsCall(String evalID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -341,10 +388,12 @@ public okhttp3.Call getEvaluationAllocationsCall(String evalID, String region, S }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -480,6 +529,19 @@ public okhttp3.Call getEvaluationAllocationsAsync(String evalID, String region, */ public okhttp3.Call getEvaluationsCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -539,10 +601,12 @@ public okhttp3.Call getEvaluationsCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/JobsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/JobsApi.java index 26def9f1..7af90654 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/JobsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/JobsApi.java @@ -57,9 +57,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class JobsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public JobsApi() { this(Configuration.getDefaultApiClient()); @@ -77,6 +80,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for deleteJob * @param jobName The job identifier. (required) @@ -100,6 +119,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteJobCall(String jobName, String region, String namespace, String xNomadToken, String idempotencyToken, Boolean purge, Boolean global, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -148,10 +180,12 @@ public okhttp3.Call deleteJobCall(String jobName, String region, String namespac }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -279,6 +313,19 @@ public okhttp3.Call deleteJobAsync(String jobName, String region, String namespa */ public okhttp3.Call getJobCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -339,10 +386,12 @@ public okhttp3.Call getJobCall(String jobName, String region, String namespace, }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -480,6 +529,19 @@ public okhttp3.Call getJobAsync(String jobName, String region, String namespace, */ public okhttp3.Call getJobAllocationsCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, Boolean all, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -544,10 +606,12 @@ public okhttp3.Call getJobAllocationsCall(String jobName, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -687,6 +751,19 @@ public okhttp3.Call getJobAllocationsAsync(String jobName, String region, String */ public okhttp3.Call getJobDeploymentCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -747,10 +824,12 @@ public okhttp3.Call getJobDeploymentCall(String jobName, String region, String n }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -888,6 +967,19 @@ public okhttp3.Call getJobDeploymentAsync(String jobName, String region, String */ public okhttp3.Call getJobDeploymentsCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, Integer all, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -952,10 +1044,12 @@ public okhttp3.Call getJobDeploymentsCall(String jobName, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1095,6 +1189,19 @@ public okhttp3.Call getJobDeploymentsAsync(String jobName, String region, String */ public okhttp3.Call getJobEvaluationsCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1155,10 +1262,12 @@ public okhttp3.Call getJobEvaluationsCall(String jobName, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1295,6 +1404,19 @@ public okhttp3.Call getJobEvaluationsAsync(String jobName, String region, String */ public okhttp3.Call getJobScaleStatusCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1355,10 +1477,12 @@ public okhttp3.Call getJobScaleStatusCall(String jobName, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1495,6 +1619,19 @@ public okhttp3.Call getJobScaleStatusAsync(String jobName, String region, String */ public okhttp3.Call getJobSummaryCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1555,10 +1692,12 @@ public okhttp3.Call getJobSummaryCall(String jobName, String region, String name }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1696,6 +1835,19 @@ public okhttp3.Call getJobSummaryAsync(String jobName, String region, String nam */ public okhttp3.Call getJobVersionsCall(String jobName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, Boolean diffs, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1760,10 +1912,12 @@ public okhttp3.Call getJobVersionsCall(String jobName, String region, String nam }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1902,6 +2056,19 @@ public okhttp3.Call getJobVersionsAsync(String jobName, String region, String na */ public okhttp3.Call getJobsCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1961,10 +2128,12 @@ public okhttp3.Call getJobsCall(String region, String namespace, Integer index, }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -2089,6 +2258,19 @@ public okhttp3.Call getJobsAsync(String region, String namespace, Integer index, */ public okhttp3.Call postJobCall(String jobName, JobRegisterRequest jobRegisterRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobRegisterRequest; // create path and map variables @@ -2129,10 +2311,12 @@ public okhttp3.Call postJobCall(String jobName, JobRegisterRequest jobRegisterRe "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -2258,6 +2442,19 @@ public okhttp3.Call postJobAsync(String jobName, JobRegisterRequest jobRegisterR */ public okhttp3.Call postJobDispatchCall(String jobName, JobDispatchRequest jobDispatchRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobDispatchRequest; // create path and map variables @@ -2298,10 +2495,12 @@ public okhttp3.Call postJobDispatchCall(String jobName, JobDispatchRequest jobDi "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -2427,6 +2626,19 @@ public okhttp3.Call postJobDispatchAsync(String jobName, JobDispatchRequest jobD */ public okhttp3.Call postJobEvaluateCall(String jobName, JobEvaluateRequest jobEvaluateRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobEvaluateRequest; // create path and map variables @@ -2467,10 +2679,12 @@ public okhttp3.Call postJobEvaluateCall(String jobName, JobEvaluateRequest jobEv "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -2591,6 +2805,19 @@ public okhttp3.Call postJobEvaluateAsync(String jobName, JobEvaluateRequest jobE */ public okhttp3.Call postJobParseCall(JobsParseRequest jobsParseRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobsParseRequest; // create path and map variables @@ -2614,10 +2841,12 @@ public okhttp3.Call postJobParseCall(JobsParseRequest jobsParseRequest, final Ap "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -2722,6 +2951,19 @@ public okhttp3.Call postJobParseAsync(JobsParseRequest jobsParseRequest, final A */ public okhttp3.Call postJobPeriodicForceCall(String jobName, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -2762,10 +3004,12 @@ public okhttp3.Call postJobPeriodicForceCall(String jobName, String region, Stri }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -2883,6 +3127,19 @@ public okhttp3.Call postJobPeriodicForceAsync(String jobName, String region, Str */ public okhttp3.Call postJobPlanCall(String jobName, JobPlanRequest jobPlanRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobPlanRequest; // create path and map variables @@ -2923,10 +3180,12 @@ public okhttp3.Call postJobPlanCall(String jobName, JobPlanRequest jobPlanReques "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -3052,6 +3311,19 @@ public okhttp3.Call postJobPlanAsync(String jobName, JobPlanRequest jobPlanReque */ public okhttp3.Call postJobRevertCall(String jobName, JobRevertRequest jobRevertRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobRevertRequest; // create path and map variables @@ -3092,10 +3364,12 @@ public okhttp3.Call postJobRevertCall(String jobName, JobRevertRequest jobRevert "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -3221,6 +3495,19 @@ public okhttp3.Call postJobRevertAsync(String jobName, JobRevertRequest jobRever */ public okhttp3.Call postJobScalingRequestCall(String jobName, ScalingRequest scalingRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = scalingRequest; // create path and map variables @@ -3261,10 +3548,12 @@ public okhttp3.Call postJobScalingRequestCall(String jobName, ScalingRequest sca "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -3390,6 +3679,19 @@ public okhttp3.Call postJobScalingRequestAsync(String jobName, ScalingRequest sc */ public okhttp3.Call postJobStabilityCall(String jobName, JobStabilityRequest jobStabilityRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobStabilityRequest; // create path and map variables @@ -3430,10 +3732,12 @@ public okhttp3.Call postJobStabilityCall(String jobName, JobStabilityRequest job "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -3558,6 +3862,19 @@ public okhttp3.Call postJobStabilityAsync(String jobName, JobStabilityRequest jo */ public okhttp3.Call postJobValidateRequestCall(JobValidateRequest jobValidateRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobValidateRequest; // create path and map variables @@ -3597,10 +3914,12 @@ public okhttp3.Call postJobValidateRequestCall(JobValidateRequest jobValidateReq "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -3717,6 +4036,19 @@ public okhttp3.Call postJobValidateRequestAsync(JobValidateRequest jobValidateRe */ public okhttp3.Call registerJobCall(JobRegisterRequest jobRegisterRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = jobRegisterRequest; // create path and map variables @@ -3756,10 +4088,12 @@ public okhttp3.Call registerJobCall(JobRegisterRequest jobRegisterRequest, Strin "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/MetricsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/MetricsApi.java index fd798a4e..0ebd147a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/MetricsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/MetricsApi.java @@ -34,9 +34,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class MetricsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public MetricsApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +57,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getMetricsSummary * @param format The format the user requested for the metrics summary (e.g. prometheus) (optional) @@ -71,6 +90,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getMetricsSummaryCall(String format, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -98,10 +130,12 @@ public okhttp3.Call getMetricsSummaryCall(String format, final ApiCallback _call }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/NamespacesApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/NamespacesApi.java index 83fa0976..e8140cb4 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/NamespacesApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/NamespacesApi.java @@ -34,9 +34,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class NamespacesApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public NamespacesApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +57,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createNamespace * @param region Filters results based on the specified region. (optional) @@ -74,6 +93,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createNamespaceCall(String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -113,10 +145,12 @@ public okhttp3.Call createNamespaceCall(String region, String namespace, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -221,6 +255,19 @@ public okhttp3.Call createNamespaceAsync(String region, String namespace, String */ public okhttp3.Call deleteNamespaceCall(String namespaceName, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -261,10 +308,12 @@ public okhttp3.Call deleteNamespaceCall(String namespaceName, String region, Str }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -382,6 +431,19 @@ public okhttp3.Call deleteNamespaceAsync(String namespaceName, String region, St */ public okhttp3.Call getNamespaceCall(String namespaceName, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -442,10 +504,12 @@ public okhttp3.Call getNamespaceCall(String namespaceName, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -581,6 +645,19 @@ public okhttp3.Call getNamespaceAsync(String namespaceName, String region, Strin */ public okhttp3.Call getNamespacesCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -640,10 +717,12 @@ public okhttp3.Call getNamespacesCall(String region, String namespace, Integer i }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -768,6 +847,19 @@ public okhttp3.Call getNamespacesAsync(String region, String namespace, Integer */ public okhttp3.Call postNamespaceCall(String namespaceName, Namespace namespace2, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = namespace2; // create path and map variables @@ -808,10 +900,12 @@ public okhttp3.Call postNamespaceCall(String namespaceName, Namespace namespace2 "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/NodesApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/NodesApi.java index 7cdeb40a..28f58ba2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/NodesApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/NodesApi.java @@ -41,9 +41,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class NodesApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public NodesApi() { this(Configuration.getDefaultApiClient()); @@ -61,6 +64,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getNode * @param nodeId The ID of the node. (required) @@ -87,6 +106,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getNodeCall(String nodeId, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -147,10 +179,12 @@ public okhttp3.Call getNodeCall(String nodeId, String region, String namespace, }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -287,6 +321,19 @@ public okhttp3.Call getNodeAsync(String nodeId, String region, String namespace, */ public okhttp3.Call getNodeAllocationsCall(String nodeId, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -347,10 +394,12 @@ public okhttp3.Call getNodeAllocationsCall(String nodeId, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -487,6 +536,19 @@ public okhttp3.Call getNodeAllocationsAsync(String nodeId, String region, String */ public okhttp3.Call getNodesCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, Boolean resources, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -550,10 +612,12 @@ public okhttp3.Call getNodesCall(String region, String namespace, Integer index, }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -686,6 +750,19 @@ public okhttp3.Call getNodesAsync(String region, String namespace, Integer index */ public okhttp3.Call updateNodeDrainCall(String nodeId, NodeUpdateDrainRequest nodeUpdateDrainRequest, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = nodeUpdateDrainRequest; // create path and map variables @@ -746,10 +823,12 @@ public okhttp3.Call updateNodeDrainCall(String nodeId, NodeUpdateDrainRequest no "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -895,6 +974,19 @@ public okhttp3.Call updateNodeDrainAsync(String nodeId, NodeUpdateDrainRequest n */ public okhttp3.Call updateNodeEligibilityCall(String nodeId, NodeUpdateEligibilityRequest nodeUpdateEligibilityRequest, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = nodeUpdateEligibilityRequest; // create path and map variables @@ -955,10 +1047,12 @@ public okhttp3.Call updateNodeEligibilityCall(String nodeId, NodeUpdateEligibili "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1103,6 +1197,19 @@ public okhttp3.Call updateNodeEligibilityAsync(String nodeId, NodeUpdateEligibil */ public okhttp3.Call updateNodePurgeCall(String nodeId, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1163,10 +1270,12 @@ public okhttp3.Call updateNodePurgeCall(String nodeId, String region, String nam }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/OperatorApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/OperatorApi.java index 6a1cc77f..c36a3aac 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/OperatorApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/OperatorApi.java @@ -39,9 +39,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class OperatorApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public OperatorApi() { this(Configuration.getDefaultApiClient()); @@ -59,6 +62,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for deleteOperatorRaftPeer * @param region Filters results based on the specified region. (optional) @@ -79,6 +98,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOperatorRaftPeerCall(String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -118,10 +150,12 @@ public okhttp3.Call deleteOperatorRaftPeerCall(String region, String namespace, }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -230,6 +264,19 @@ public okhttp3.Call deleteOperatorRaftPeerAsync(String region, String namespace, */ public okhttp3.Call getOperatorAutopilotConfigurationCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -289,10 +336,12 @@ public okhttp3.Call getOperatorAutopilotConfigurationCall(String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -420,6 +469,19 @@ public okhttp3.Call getOperatorAutopilotConfigurationAsync(String region, String */ public okhttp3.Call getOperatorAutopilotHealthCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -479,10 +541,12 @@ public okhttp3.Call getOperatorAutopilotHealthCall(String region, String namespa }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -610,6 +674,19 @@ public okhttp3.Call getOperatorAutopilotHealthAsync(String region, String namesp */ public okhttp3.Call getOperatorRaftConfigurationCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -669,10 +746,12 @@ public okhttp3.Call getOperatorRaftConfigurationCall(String region, String names }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -800,6 +879,19 @@ public okhttp3.Call getOperatorRaftConfigurationAsync(String region, String name */ public okhttp3.Call getOperatorSchedulerConfigurationCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -859,10 +951,12 @@ public okhttp3.Call getOperatorSchedulerConfigurationCall(String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -986,6 +1080,19 @@ public okhttp3.Call getOperatorSchedulerConfigurationAsync(String region, String */ public okhttp3.Call postOperatorSchedulerConfigurationCall(SchedulerConfiguration schedulerConfiguration, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = schedulerConfiguration; // create path and map variables @@ -1025,10 +1132,12 @@ public okhttp3.Call postOperatorSchedulerConfigurationCall(SchedulerConfiguratio "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1145,6 +1254,19 @@ public okhttp3.Call postOperatorSchedulerConfigurationAsync(SchedulerConfigurati */ public okhttp3.Call putOperatorAutopilotConfigurationCall(AutopilotConfiguration autopilotConfiguration, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = autopilotConfiguration; // create path and map variables @@ -1184,10 +1306,12 @@ public okhttp3.Call putOperatorAutopilotConfigurationCall(AutopilotConfiguration "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/PluginsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/PluginsApi.java index d002120b..af7f373a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/PluginsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/PluginsApi.java @@ -35,9 +35,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class PluginsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public PluginsApi() { this(Configuration.getDefaultApiClient()); @@ -55,6 +58,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getPluginCSI * @param pluginID The CSI plugin identifier. (required) @@ -81,6 +100,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getPluginCSICall(String pluginID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -141,10 +173,12 @@ public okhttp3.Call getPluginCSICall(String pluginID, String region, String name }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -280,6 +314,19 @@ public okhttp3.Call getPluginCSIAsync(String pluginID, String region, String nam */ public okhttp3.Call getPluginsCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -339,10 +386,12 @@ public okhttp3.Call getPluginsCall(String region, String namespace, Integer inde }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/RegionsApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/RegionsApi.java index 7365cd49..87a376d7 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/RegionsApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/RegionsApi.java @@ -33,9 +33,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class RegionsApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public RegionsApi() { this(Configuration.getDefaultApiClient()); @@ -53,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getRegions * @param _callback Callback for upload/download progress @@ -69,6 +88,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getRegionsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -92,10 +124,12 @@ public okhttp3.Call getRegionsCall(final ApiCallback _callback) throws ApiExcept }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/ScalingApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/ScalingApi.java index c70cf739..67ce1763 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/ScalingApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/ScalingApi.java @@ -35,9 +35,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class ScalingApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public ScalingApi() { this(Configuration.getDefaultApiClient()); @@ -55,6 +58,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getScalingPolicies * @param region Filters results based on the specified region. (optional) @@ -80,6 +99,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getScalingPoliciesCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -139,10 +171,12 @@ public okhttp3.Call getScalingPoliciesCall(String region, String namespace, Inte }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -271,6 +305,19 @@ public okhttp3.Call getScalingPoliciesAsync(String region, String namespace, Int */ public okhttp3.Call getScalingPolicyCall(String policyID, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -331,10 +378,12 @@ public okhttp3.Call getScalingPolicyCall(String policyID, String region, String }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/SearchApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/SearchApi.java index 38515243..e2722943 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/SearchApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/SearchApi.java @@ -37,9 +37,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class SearchApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public SearchApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +60,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getFuzzySearch * @param fuzzySearchRequest (required) @@ -83,6 +102,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getFuzzySearchCall(FuzzySearchRequest fuzzySearchRequest, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = fuzzySearchRequest; // create path and map variables @@ -142,10 +174,12 @@ public okhttp3.Call getFuzzySearchCall(FuzzySearchRequest fuzzySearchRequest, St "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -282,6 +316,19 @@ public okhttp3.Call getFuzzySearchAsync(FuzzySearchRequest fuzzySearchRequest, S */ public okhttp3.Call getSearchCall(SearchRequest searchRequest, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = searchRequest; // create path and map variables @@ -341,10 +388,12 @@ public okhttp3.Call getSearchCall(SearchRequest searchRequest, String region, St "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/StatusApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/StatusApi.java index 07020895..c6d9c886 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/StatusApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/StatusApi.java @@ -33,9 +33,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class StatusApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public StatusApi() { this(Configuration.getDefaultApiClient()); @@ -53,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for getStatusLeader * @param region Filters results based on the specified region. (optional) @@ -78,6 +97,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call getStatusLeaderCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -137,10 +169,12 @@ public okhttp3.Call getStatusLeaderCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -268,6 +302,19 @@ public okhttp3.Call getStatusLeaderAsync(String region, String namespace, Intege */ public okhttp3.Call getStatusPeersCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -327,10 +374,12 @@ public okhttp3.Call getStatusPeersCall(String region, String namespace, Integer }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/SystemApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/SystemApi.java index 2cba8217..977449a0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/SystemApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/SystemApi.java @@ -33,9 +33,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class SystemApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public SystemApi() { this(Configuration.getDefaultApiClient()); @@ -53,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for putSystemGC * @param region Filters results based on the specified region. (optional) @@ -73,6 +92,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call putSystemGCCall(String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -112,10 +144,12 @@ public okhttp3.Call putSystemGCCall(String region, String namespace, String xNom }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -219,6 +253,19 @@ public okhttp3.Call putSystemGCAsync(String region, String namespace, String xNo */ public okhttp3.Call putSystemReconcileSummariesCall(String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -258,10 +305,12 @@ public okhttp3.Call putSystemReconcileSummariesCall(String region, String namesp }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/api/VolumesApi.java b/clients/java/v1/src/main/java/io/nomadproject/client/api/VolumesApi.java index 02ea8890..b5fb0c59 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/api/VolumesApi.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/api/VolumesApi.java @@ -41,9 +41,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class VolumesApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public VolumesApi() { this(Configuration.getDefaultApiClient()); @@ -61,6 +64,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createVolume * @param volumeId Volume unique identifier. (required) @@ -84,6 +103,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createVolumeCall(String volumeId, String action, CSIVolumeCreateRequest csIVolumeCreateRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = csIVolumeCreateRequest; // create path and map variables @@ -125,10 +157,12 @@ public okhttp3.Call createVolumeCall(String volumeId, String action, CSIVolumeCr "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -258,6 +292,19 @@ public okhttp3.Call createVolumeAsync(String volumeId, String action, CSIVolumeC */ public okhttp3.Call deleteSnapshotCall(String region, String namespace, String xNomadToken, String idempotencyToken, String pluginId, String snapshotId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -305,10 +352,12 @@ public okhttp3.Call deleteSnapshotCall(String region, String namespace, String x }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -420,6 +469,19 @@ public okhttp3.Call deleteSnapshotAsync(String region, String namespace, String */ public okhttp3.Call deleteVolumeRegistrationCall(String volumeId, String region, String namespace, String xNomadToken, String idempotencyToken, String force, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -464,10 +526,12 @@ public okhttp3.Call deleteVolumeRegistrationCall(String volumeId, String region, }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -585,6 +649,19 @@ public okhttp3.Call deleteVolumeRegistrationAsync(String volumeId, String region */ public okhttp3.Call detachOrDeleteVolumeCall(String volumeId, String action, String region, String namespace, String xNomadToken, String idempotencyToken, String node, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -630,10 +707,12 @@ public okhttp3.Call detachOrDeleteVolumeCall(String volumeId, String action, Str }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -762,6 +841,19 @@ public okhttp3.Call detachOrDeleteVolumeAsync(String volumeId, String action, St */ public okhttp3.Call getExternalVolumesCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, String pluginId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -825,10 +917,12 @@ public okhttp3.Call getExternalVolumesCall(String region, String namespace, Inte }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -960,6 +1054,19 @@ public okhttp3.Call getExternalVolumesAsync(String region, String namespace, Int */ public okhttp3.Call getSnapshotsCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, String pluginId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1023,10 +1130,12 @@ public okhttp3.Call getSnapshotsCall(String region, String namespace, Integer in }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1158,6 +1267,19 @@ public okhttp3.Call getSnapshotsAsync(String region, String namespace, Integer i */ public okhttp3.Call getVolumeCall(String volumeId, String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1218,10 +1340,12 @@ public okhttp3.Call getVolumeCall(String volumeId, String region, String namespa }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1360,6 +1484,19 @@ public okhttp3.Call getVolumeAsync(String volumeId, String region, String namesp */ public okhttp3.Call getVolumesCall(String region, String namespace, Integer index, String wait, String stale, String prefix, String xNomadToken, Integer perPage, String nextToken, String nodeId, String pluginId, String type, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1431,10 +1568,12 @@ public okhttp3.Call getVolumesCall(String region, String namespace, Integer inde }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1567,6 +1706,19 @@ public okhttp3.Call getVolumesAsync(String region, String namespace, Integer ind */ public okhttp3.Call postSnapshotCall(CSISnapshotCreateRequest csISnapshotCreateRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = csISnapshotCreateRequest; // create path and map variables @@ -1606,10 +1758,12 @@ public okhttp3.Call postSnapshotCall(CSISnapshotCreateRequest csISnapshotCreateR "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1726,6 +1880,19 @@ public okhttp3.Call postSnapshotAsync(CSISnapshotCreateRequest csISnapshotCreate */ public okhttp3.Call postVolumeCall(CSIVolumeRegisterRequest csIVolumeRegisterRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = csIVolumeRegisterRequest; // create path and map variables @@ -1765,10 +1932,12 @@ public okhttp3.Call postVolumeCall(CSIVolumeRegisterRequest csIVolumeRegisterReq "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1882,6 +2051,19 @@ public okhttp3.Call postVolumeAsync(CSIVolumeRegisterRequest csIVolumeRegisterRe */ public okhttp3.Call postVolumeRegistrationCall(String volumeId, CSIVolumeRegisterRequest csIVolumeRegisterRequest, String region, String namespace, String xNomadToken, String idempotencyToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = csIVolumeRegisterRequest; // create path and map variables @@ -1922,10 +2104,12 @@ public okhttp3.Call postVolumeRegistrationCall(String volumeId, CSIVolumeRegiste "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "X-Nomad-Token" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/auth/ApiKeyAuth.java b/clients/java/v1/src/main/java/io/nomadproject/client/auth/ApiKeyAuth.java index 74f3a584..8cbe1b9b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/auth/ApiKeyAuth.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/auth/ApiKeyAuth.java @@ -13,8 +13,10 @@ package io.nomadproject.client.auth; +import io.nomadproject.client.ApiException; import io.nomadproject.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -56,7 +58,8 @@ public void setApiKeyPrefix(String apiKeyPrefix) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { if (apiKey == null) { return; } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/auth/Authentication.java b/clients/java/v1/src/main/java/io/nomadproject/client/auth/Authentication.java index 045a3098..e2f76861 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/auth/Authentication.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/auth/Authentication.java @@ -14,7 +14,9 @@ package io.nomadproject.client.auth; import io.nomadproject.client.Pair; +import io.nomadproject.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -25,6 +27,10 @@ public interface Authentication { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBasicAuth.java b/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBasicAuth.java index 5a498ab3..a90a39ab 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBasicAuth.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBasicAuth.java @@ -14,9 +14,11 @@ package io.nomadproject.client.auth; import io.nomadproject.client.Pair; +import io.nomadproject.client.ApiException; import okhttp3.Credentials; +import java.net.URI; import java.util.Map; import java.util.List; @@ -43,7 +45,8 @@ public void setPassword(String password) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { if (username == null && password == null) { return; } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBearerAuth.java b/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBearerAuth.java index 9c0a233a..91cab53f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBearerAuth.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/auth/HttpBearerAuth.java @@ -13,8 +13,10 @@ package io.nomadproject.client.auth; +import io.nomadproject.client.ApiException; import io.nomadproject.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -46,8 +48,9 @@ public void setBearerToken(String bearerToken) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { return; } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicy.java index a8296989..b45bdd54 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicy.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ACLPolicy */ @@ -49,6 +69,8 @@ public class ACLPolicy { @SerializedName(SERIALIZED_NAME_RULES) private String rules; + public ACLPolicy() { + } public ACLPolicy createIndex(Integer createIndex) { @@ -169,6 +191,7 @@ public void setRules(String rules) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -214,5 +237,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Description"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("Rules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ACLPolicy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ACLPolicy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ACLPolicy is not found in the empty JSON string", ACLPolicy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ACLPolicy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ACLPolicy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Rules") != null && !jsonObj.get("Rules").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Rules` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Rules").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ACLPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ACLPolicy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ACLPolicy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ACLPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ACLPolicy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ACLPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ACLPolicy + * @throws IOException if the JSON string is invalid with respect to ACLPolicy + */ + public static ACLPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ACLPolicy.class); + } + + /** + * Convert an instance of ACLPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicyListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicyListStub.java index 98b7431f..a689cdb5 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicyListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLPolicyListStub.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ACLPolicyListStub */ @@ -45,6 +65,8 @@ public class ACLPolicyListStub { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public ACLPolicyListStub() { + } public ACLPolicyListStub createIndex(Integer createIndex) { @@ -142,6 +164,7 @@ public void setName(String name) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -185,5 +208,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Description"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ACLPolicyListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ACLPolicyListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ACLPolicyListStub is not found in the empty JSON string", ACLPolicyListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ACLPolicyListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ACLPolicyListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ACLPolicyListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ACLPolicyListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ACLPolicyListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ACLPolicyListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ACLPolicyListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ACLPolicyListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of ACLPolicyListStub + * @throws IOException if the JSON string is invalid with respect to ACLPolicyListStub + */ + public static ACLPolicyListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ACLPolicyListStub.class); + } + + /** + * Convert an instance of ACLPolicyListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLToken.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLToken.java index 715ad38c..9d228e8e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLToken.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLToken.java @@ -23,9 +23,30 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ACLToken @@ -68,6 +89,8 @@ public class ACLToken { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public ACLToken() { + } public ACLToken accessorID(String accessorID) { @@ -219,7 +242,7 @@ public ACLToken policies(List policies) { public ACLToken addPoliciesItem(String policiesItem) { if (this.policies == null) { - this.policies = new ArrayList(); + this.policies = new ArrayList<>(); } this.policies.add(policiesItem); return this; @@ -288,6 +311,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -308,11 +332,22 @@ public boolean equals(Object o) { Objects.equals(this.type, acLToken.type); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessorID, createIndex, createTime, global, modifyIndex, name, policies, secretID, type); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -341,5 +376,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessorID"); + openapiFields.add("CreateIndex"); + openapiFields.add("CreateTime"); + openapiFields.add("Global"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("Policies"); + openapiFields.add("SecretID"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ACLToken + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ACLToken.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ACLToken is not found in the empty JSON string", ACLToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ACLToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ACLToken` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessorID") != null && !jsonObj.get("AccessorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessorID").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Policies") != null && !jsonObj.get("Policies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Policies` to be an array in the JSON string but got `%s`", jsonObj.get("Policies").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ACLToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ACLToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ACLToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ACLToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ACLToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ACLToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of ACLToken + * @throws IOException if the JSON string is invalid with respect to ACLToken + */ + public static ACLToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ACLToken.class); + } + + /** + * Convert an instance of ACLToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLTokenListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLTokenListStub.java index a07b0ea7..7a2053aa 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLTokenListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ACLTokenListStub.java @@ -23,9 +23,30 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ACLTokenListStub @@ -64,6 +85,8 @@ public class ACLTokenListStub { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public ACLTokenListStub() { + } public ACLTokenListStub accessorID(String accessorID) { @@ -215,7 +238,7 @@ public ACLTokenListStub policies(List policies) { public ACLTokenListStub addPoliciesItem(String policiesItem) { if (this.policies == null) { - this.policies = new ArrayList(); + this.policies = new ArrayList<>(); } this.policies.add(policiesItem); return this; @@ -261,6 +284,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -280,11 +304,22 @@ public boolean equals(Object o) { Objects.equals(this.type, acLTokenListStub.type); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessorID, createIndex, createTime, global, modifyIndex, name, policies, type); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -312,5 +347,110 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessorID"); + openapiFields.add("CreateIndex"); + openapiFields.add("CreateTime"); + openapiFields.add("Global"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("Policies"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ACLTokenListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ACLTokenListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ACLTokenListStub is not found in the empty JSON string", ACLTokenListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ACLTokenListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ACLTokenListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessorID") != null && !jsonObj.get("AccessorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessorID").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Policies") != null && !jsonObj.get("Policies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Policies` to be an array in the JSON string but got `%s`", jsonObj.get("Policies").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ACLTokenListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ACLTokenListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ACLTokenListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ACLTokenListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ACLTokenListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ACLTokenListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of ACLTokenListStub + * @throws IOException if the JSON string is invalid with respect to ACLTokenListStub + */ + public static ACLTokenListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ACLTokenListStub.class); + } + + /** + * Convert an instance of ACLTokenListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AbstractOpenApiSchema.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AbstractOpenApiSchema.java new file mode 100644 index 00000000..0e625281 --- /dev/null +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Nomad + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.4 + * Contact: support@hashicorp.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.nomadproject.client.models; + +import io.nomadproject.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Affinity.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Affinity.java index 77448c78..4260ef87 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Affinity.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Affinity.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Affinity */ @@ -45,6 +65,8 @@ public class Affinity { @SerializedName(SERIALIZED_NAME_WEIGHT) private Integer weight; + public Affinity() { + } public Affinity ltarget(String ltarget) { @@ -140,6 +162,7 @@ public void setWeight(Integer weight) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -183,5 +206,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("LTarget"); + openapiFields.add("Operand"); + openapiFields.add("RTarget"); + openapiFields.add("Weight"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Affinity + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Affinity.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Affinity is not found in the empty JSON string", Affinity.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Affinity.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Affinity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("LTarget") != null && !jsonObj.get("LTarget").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LTarget").toString())); + } + if (jsonObj.get("Operand") != null && !jsonObj.get("Operand").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operand").toString())); + } + if (jsonObj.get("RTarget") != null && !jsonObj.get("RTarget").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RTarget").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Affinity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Affinity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Affinity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Affinity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Affinity read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Affinity given an JSON string + * + * @param jsonString JSON string + * @return An instance of Affinity + * @throws IOException if the JSON string is invalid with respect to Affinity + */ + public static Affinity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Affinity.class); + } + + /** + * Convert an instance of Affinity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocDeploymentStatus.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocDeploymentStatus.java index fb74515f..b4dad300 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocDeploymentStatus.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocDeploymentStatus.java @@ -23,7 +23,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * AllocDeploymentStatus @@ -46,6 +67,8 @@ public class AllocDeploymentStatus { @SerializedName(SERIALIZED_NAME_TIMESTAMP) private OffsetDateTime timestamp; + public AllocDeploymentStatus() { + } public AllocDeploymentStatus canary(Boolean canary) { @@ -141,6 +164,7 @@ public void setTimestamp(OffsetDateTime timestamp) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -156,11 +180,22 @@ public boolean equals(Object o) { Objects.equals(this.timestamp, allocDeploymentStatus.timestamp); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(canary, healthy, modifyIndex, timestamp); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -184,5 +219,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Canary"); + openapiFields.add("Healthy"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocDeploymentStatus + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocDeploymentStatus.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocDeploymentStatus is not found in the empty JSON string", AllocDeploymentStatus.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocDeploymentStatus.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocDeploymentStatus` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocDeploymentStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocDeploymentStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocDeploymentStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocDeploymentStatus value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocDeploymentStatus read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocDeploymentStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocDeploymentStatus + * @throws IOException if the JSON string is invalid with respect to AllocDeploymentStatus + */ + public static AllocDeploymentStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocDeploymentStatus.class); + } + + /** + * Convert an instance of AllocDeploymentStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocStopResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocStopResponse.java index fe6ef282..6c8a1bb7 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocStopResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocStopResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AllocStopResponse */ @@ -37,6 +57,8 @@ public class AllocStopResponse { @SerializedName(SERIALIZED_NAME_INDEX) private Integer index; + public AllocStopResponse() { + } public AllocStopResponse evalID(String evalID) { @@ -86,6 +108,7 @@ public void setIndex(Integer index) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -125,5 +148,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalID"); + openapiFields.add("Index"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocStopResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocStopResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocStopResponse is not found in the empty JSON string", AllocStopResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocStopResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocStopResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocStopResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocStopResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocStopResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocStopResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocStopResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocStopResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocStopResponse + * @throws IOException if the JSON string is invalid with respect to AllocStopResponse + */ + public static AllocStopResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocStopResponse.class); + } + + /** + * Convert an instance of AllocStopResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedCpuResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedCpuResources.java index 8a3aee33..8e676219 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedCpuResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedCpuResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AllocatedCpuResources */ @@ -33,6 +53,8 @@ public class AllocatedCpuResources { @SerializedName(SERIALIZED_NAME_CPU_SHARES) private Long cpuShares; + public AllocatedCpuResources() { + } public AllocatedCpuResources cpuShares(Long cpuShares) { @@ -57,6 +79,7 @@ public void setCpuShares(Long cpuShares) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CpuShares"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocatedCpuResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocatedCpuResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocatedCpuResources is not found in the empty JSON string", AllocatedCpuResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocatedCpuResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocatedCpuResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocatedCpuResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocatedCpuResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocatedCpuResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocatedCpuResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocatedCpuResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocatedCpuResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocatedCpuResources + * @throws IOException if the JSON string is invalid with respect to AllocatedCpuResources + */ + public static AllocatedCpuResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocatedCpuResources.class); + } + + /** + * Convert an instance of AllocatedCpuResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedDeviceResource.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedDeviceResource.java index 4389877d..fb899f70 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedDeviceResource.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedDeviceResource.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AllocatedDeviceResource */ @@ -47,6 +67,8 @@ public class AllocatedDeviceResource { @SerializedName(SERIALIZED_NAME_VENDOR) private String vendor; + public AllocatedDeviceResource() { + } public AllocatedDeviceResource deviceIDs(List deviceIDs) { @@ -56,7 +78,7 @@ public AllocatedDeviceResource deviceIDs(List deviceIDs) { public AllocatedDeviceResource addDeviceIDsItem(String deviceIDsItem) { if (this.deviceIDs == null) { - this.deviceIDs = new ArrayList(); + this.deviceIDs = new ArrayList<>(); } this.deviceIDs.add(deviceIDsItem); return this; @@ -148,6 +170,7 @@ public void setVendor(String vendor) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -191,5 +214,106 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DeviceIDs"); + openapiFields.add("Name"); + openapiFields.add("Type"); + openapiFields.add("Vendor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocatedDeviceResource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocatedDeviceResource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocatedDeviceResource is not found in the empty JSON string", AllocatedDeviceResource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocatedDeviceResource.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocatedDeviceResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("DeviceIDs") != null && !jsonObj.get("DeviceIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `DeviceIDs` to be an array in the JSON string but got `%s`", jsonObj.get("DeviceIDs").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if (jsonObj.get("Vendor") != null && !jsonObj.get("Vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Vendor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocatedDeviceResource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocatedDeviceResource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocatedDeviceResource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocatedDeviceResource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocatedDeviceResource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocatedDeviceResource given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocatedDeviceResource + * @throws IOException if the JSON string is invalid with respect to AllocatedDeviceResource + */ + public static AllocatedDeviceResource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocatedDeviceResource.class); + } + + /** + * Convert an instance of AllocatedDeviceResource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedMemoryResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedMemoryResources.java index 6729463f..e2b79f64 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedMemoryResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedMemoryResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AllocatedMemoryResources */ @@ -37,6 +57,8 @@ public class AllocatedMemoryResources { @SerializedName(SERIALIZED_NAME_MEMORY_MAX_M_B) private Long memoryMaxMB; + public AllocatedMemoryResources() { + } public AllocatedMemoryResources memoryMB(Long memoryMB) { @@ -84,6 +106,7 @@ public void setMemoryMaxMB(Long memoryMaxMB) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("MemoryMB"); + openapiFields.add("MemoryMaxMB"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocatedMemoryResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocatedMemoryResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocatedMemoryResources is not found in the empty JSON string", AllocatedMemoryResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocatedMemoryResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocatedMemoryResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocatedMemoryResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocatedMemoryResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocatedMemoryResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocatedMemoryResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocatedMemoryResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocatedMemoryResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocatedMemoryResources + * @throws IOException if the JSON string is invalid with respect to AllocatedMemoryResources + */ + public static AllocatedMemoryResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocatedMemoryResources.class); + } + + /** + * Convert an instance of AllocatedMemoryResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedResources.java index 2e1b3a2a..e7118203 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedResources.java @@ -28,6 +28,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * AllocatedResources @@ -42,6 +63,8 @@ public class AllocatedResources { @SerializedName(SERIALIZED_NAME_TASKS) private Map tasks = null; + public AllocatedResources() { + } public AllocatedResources shared(AllocatedSharedResources shared) { @@ -74,7 +97,7 @@ public AllocatedResources tasks(Map tasks) { public AllocatedResources putTasksItem(String key, AllocatedTaskResources tasksItem) { if (this.tasks == null) { - this.tasks = new HashMap(); + this.tasks = new HashMap<>(); } this.tasks.put(key, tasksItem); return this; @@ -97,6 +120,7 @@ public void setTasks(Map tasks) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -110,11 +134,22 @@ public boolean equals(Object o) { Objects.equals(this.tasks, allocatedResources.tasks); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(shared, tasks); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +171,95 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Shared"); + openapiFields.add("Tasks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocatedResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocatedResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocatedResources is not found in the empty JSON string", AllocatedResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocatedResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocatedResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Shared` + if (jsonObj.getAsJsonObject("Shared") != null) { + AllocatedSharedResources.validateJsonObject(jsonObj.getAsJsonObject("Shared")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocatedResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocatedResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocatedResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocatedResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocatedResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocatedResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocatedResources + * @throws IOException if the JSON string is invalid with respect to AllocatedResources + */ + public static AllocatedResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocatedResources.class); + } + + /** + * Convert an instance of AllocatedResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedSharedResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedSharedResources.java index c8efafff..695151c9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedSharedResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedSharedResources.java @@ -28,6 +28,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AllocatedSharedResources */ @@ -45,6 +65,8 @@ public class AllocatedSharedResources { @SerializedName(SERIALIZED_NAME_PORTS) private List ports = null; + public AllocatedSharedResources() { + } public AllocatedSharedResources diskMB(Long diskMB) { @@ -77,7 +99,7 @@ public AllocatedSharedResources networks(List networks) { public AllocatedSharedResources addNetworksItem(NetworkResource networksItem) { if (this.networks == null) { - this.networks = new ArrayList(); + this.networks = new ArrayList<>(); } this.networks.add(networksItem); return this; @@ -108,7 +130,7 @@ public AllocatedSharedResources ports(List ports) { public AllocatedSharedResources addPortsItem(PortMapping portsItem) { if (this.ports == null) { - this.ports = new ArrayList(); + this.ports = new ArrayList<>(); } this.ports.add(portsItem); return this; @@ -131,6 +153,7 @@ public void setPorts(List ports) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -172,5 +195,116 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DiskMB"); + openapiFields.add("Networks"); + openapiFields.add("Ports"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocatedSharedResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocatedSharedResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocatedSharedResources is not found in the empty JSON string", AllocatedSharedResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocatedSharedResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocatedSharedResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraynetworks = jsonObj.getAsJsonArray("Networks"); + if (jsonArraynetworks != null) { + // ensure the json data is an array + if (!jsonObj.get("Networks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Networks` to be an array in the JSON string but got `%s`", jsonObj.get("Networks").toString())); + } + + // validate the optional field `Networks` (array) + for (int i = 0; i < jsonArraynetworks.size(); i++) { + NetworkResource.validateJsonObject(jsonArraynetworks.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArrayports = jsonObj.getAsJsonArray("Ports"); + if (jsonArrayports != null) { + // ensure the json data is an array + if (!jsonObj.get("Ports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Ports` to be an array in the JSON string but got `%s`", jsonObj.get("Ports").toString())); + } + + // validate the optional field `Ports` (array) + for (int i = 0; i < jsonArrayports.size(); i++) { + PortMapping.validateJsonObject(jsonArrayports.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocatedSharedResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocatedSharedResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocatedSharedResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocatedSharedResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocatedSharedResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocatedSharedResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocatedSharedResources + * @throws IOException if the JSON string is invalid with respect to AllocatedSharedResources + */ + public static AllocatedSharedResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocatedSharedResources.class); + } + + /** + * Convert an instance of AllocatedSharedResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedTaskResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedTaskResources.java index bd2cea8c..4122c094 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedTaskResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocatedTaskResources.java @@ -29,6 +29,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * AllocatedTaskResources @@ -51,6 +72,8 @@ public class AllocatedTaskResources { @SerializedName(SERIALIZED_NAME_NETWORKS) private List networks = null; + public AllocatedTaskResources() { + } public AllocatedTaskResources cpu(AllocatedCpuResources cpu) { @@ -83,7 +106,7 @@ public AllocatedTaskResources devices(List devices) { public AllocatedTaskResources addDevicesItem(AllocatedDeviceResource devicesItem) { if (this.devices == null) { - this.devices = new ArrayList(); + this.devices = new ArrayList<>(); } this.devices.add(devicesItem); return this; @@ -137,7 +160,7 @@ public AllocatedTaskResources networks(List networks) { public AllocatedTaskResources addNetworksItem(NetworkResource networksItem) { if (this.networks == null) { - this.networks = new ArrayList(); + this.networks = new ArrayList<>(); } this.networks.add(networksItem); return this; @@ -160,6 +183,7 @@ public void setNetworks(List networks) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -175,11 +199,22 @@ public boolean equals(Object o) { Objects.equals(this.networks, allocatedTaskResources.networks); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(cpu, devices, memory, networks); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -203,5 +238,125 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Cpu"); + openapiFields.add("Devices"); + openapiFields.add("Memory"); + openapiFields.add("Networks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocatedTaskResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocatedTaskResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocatedTaskResources is not found in the empty JSON string", AllocatedTaskResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocatedTaskResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocatedTaskResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Cpu` + if (jsonObj.getAsJsonObject("Cpu") != null) { + AllocatedCpuResources.validateJsonObject(jsonObj.getAsJsonObject("Cpu")); + } + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("Devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("Devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Devices` to be an array in the JSON string but got `%s`", jsonObj.get("Devices").toString())); + } + + // validate the optional field `Devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + AllocatedDeviceResource.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; + } + // validate the optional field `Memory` + if (jsonObj.getAsJsonObject("Memory") != null) { + AllocatedMemoryResources.validateJsonObject(jsonObj.getAsJsonObject("Memory")); + } + JsonArray jsonArraynetworks = jsonObj.getAsJsonArray("Networks"); + if (jsonArraynetworks != null) { + // ensure the json data is an array + if (!jsonObj.get("Networks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Networks` to be an array in the JSON string but got `%s`", jsonObj.get("Networks").toString())); + } + + // validate the optional field `Networks` (array) + for (int i = 0; i < jsonArraynetworks.size(); i++) { + NetworkResource.validateJsonObject(jsonArraynetworks.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocatedTaskResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocatedTaskResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocatedTaskResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocatedTaskResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocatedTaskResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocatedTaskResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocatedTaskResources + * @throws IOException if the JSON string is invalid with respect to AllocatedTaskResources + */ + public static AllocatedTaskResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocatedTaskResources.class); + } + + /** + * Convert an instance of AllocatedTaskResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Allocation.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Allocation.java index ccebb6e4..a09007a1 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Allocation.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Allocation.java @@ -35,6 +35,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Allocation @@ -173,6 +194,8 @@ public class Allocation { @SerializedName(SERIALIZED_NAME_TASK_STATES) private Map taskStates = null; + public Allocation() { + } public Allocation allocModifyIndex(Integer allocModifyIndex) { @@ -740,7 +763,7 @@ public Allocation preemptedAllocations(List preemptedAllocations) { public Allocation addPreemptedAllocationsItem(String preemptedAllocationsItem) { if (this.preemptedAllocations == null) { - this.preemptedAllocations = new ArrayList(); + this.preemptedAllocations = new ArrayList<>(); } this.preemptedAllocations.add(preemptedAllocationsItem); return this; @@ -863,7 +886,7 @@ public Allocation services(Map services) { public Allocation putServicesItem(String key, String servicesItem) { if (this.services == null) { - this.services = new HashMap(); + this.services = new HashMap<>(); } this.services.put(key, servicesItem); return this; @@ -917,7 +940,7 @@ public Allocation taskResources(Map taskResources) { public Allocation putTaskResourcesItem(String key, Resources taskResourcesItem) { if (this.taskResources == null) { - this.taskResources = new HashMap(); + this.taskResources = new HashMap<>(); } this.taskResources.put(key, taskResourcesItem); return this; @@ -948,7 +971,7 @@ public Allocation taskStates(Map taskStates) { public Allocation putTaskStatesItem(String key, TaskState taskStatesItem) { if (this.taskStates == null) { - this.taskStates = new HashMap(); + this.taskStates = new HashMap<>(); } this.taskStates.put(key, taskStatesItem); return this; @@ -971,6 +994,7 @@ public void setTaskStates(Map taskStates) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -1015,11 +1039,22 @@ public boolean equals(Object o) { Objects.equals(this.taskStates, allocation.taskStates); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(allocModifyIndex, allocatedResources, clientDescription, clientStatus, createIndex, createTime, deploymentID, deploymentStatus, desiredDescription, desiredStatus, desiredTransition, evalID, followupEvalID, ID, job, jobID, metrics, modifyIndex, modifyTime, name, namespace, nextAllocation, nodeID, nodeName, preemptedAllocations, preemptedByAllocation, previousAllocation, rescheduleTracker, resources, services, taskGroup, taskResources, taskStates); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1072,5 +1107,205 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AllocModifyIndex"); + openapiFields.add("AllocatedResources"); + openapiFields.add("ClientDescription"); + openapiFields.add("ClientStatus"); + openapiFields.add("CreateIndex"); + openapiFields.add("CreateTime"); + openapiFields.add("DeploymentID"); + openapiFields.add("DeploymentStatus"); + openapiFields.add("DesiredDescription"); + openapiFields.add("DesiredStatus"); + openapiFields.add("DesiredTransition"); + openapiFields.add("EvalID"); + openapiFields.add("FollowupEvalID"); + openapiFields.add("ID"); + openapiFields.add("Job"); + openapiFields.add("JobID"); + openapiFields.add("Metrics"); + openapiFields.add("ModifyIndex"); + openapiFields.add("ModifyTime"); + openapiFields.add("Name"); + openapiFields.add("Namespace"); + openapiFields.add("NextAllocation"); + openapiFields.add("NodeID"); + openapiFields.add("NodeName"); + openapiFields.add("PreemptedAllocations"); + openapiFields.add("PreemptedByAllocation"); + openapiFields.add("PreviousAllocation"); + openapiFields.add("RescheduleTracker"); + openapiFields.add("Resources"); + openapiFields.add("Services"); + openapiFields.add("TaskGroup"); + openapiFields.add("TaskResources"); + openapiFields.add("TaskStates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Allocation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Allocation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Allocation is not found in the empty JSON string", Allocation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Allocation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Allocation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `AllocatedResources` + if (jsonObj.getAsJsonObject("AllocatedResources") != null) { + AllocatedResources.validateJsonObject(jsonObj.getAsJsonObject("AllocatedResources")); + } + if (jsonObj.get("ClientDescription") != null && !jsonObj.get("ClientDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientDescription").toString())); + } + if (jsonObj.get("ClientStatus") != null && !jsonObj.get("ClientStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientStatus").toString())); + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + // validate the optional field `DeploymentStatus` + if (jsonObj.getAsJsonObject("DeploymentStatus") != null) { + AllocDeploymentStatus.validateJsonObject(jsonObj.getAsJsonObject("DeploymentStatus")); + } + if (jsonObj.get("DesiredDescription") != null && !jsonObj.get("DesiredDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DesiredDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DesiredDescription").toString())); + } + if (jsonObj.get("DesiredStatus") != null && !jsonObj.get("DesiredStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DesiredStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DesiredStatus").toString())); + } + // validate the optional field `DesiredTransition` + if (jsonObj.getAsJsonObject("DesiredTransition") != null) { + DesiredTransition.validateJsonObject(jsonObj.getAsJsonObject("DesiredTransition")); + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + if (jsonObj.get("FollowupEvalID") != null && !jsonObj.get("FollowupEvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FollowupEvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FollowupEvalID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `Job` + if (jsonObj.getAsJsonObject("Job") != null) { + Job.validateJsonObject(jsonObj.getAsJsonObject("Job")); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + // validate the optional field `Metrics` + if (jsonObj.getAsJsonObject("Metrics") != null) { + AllocationMetric.validateJsonObject(jsonObj.getAsJsonObject("Metrics")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NextAllocation") != null && !jsonObj.get("NextAllocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextAllocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextAllocation").toString())); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + if (jsonObj.get("NodeName") != null && !jsonObj.get("NodeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeName").toString())); + } + // ensure the json data is an array + if (jsonObj.get("PreemptedAllocations") != null && !jsonObj.get("PreemptedAllocations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreemptedAllocations` to be an array in the JSON string but got `%s`", jsonObj.get("PreemptedAllocations").toString())); + } + if (jsonObj.get("PreemptedByAllocation") != null && !jsonObj.get("PreemptedByAllocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PreemptedByAllocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PreemptedByAllocation").toString())); + } + if (jsonObj.get("PreviousAllocation") != null && !jsonObj.get("PreviousAllocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousAllocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PreviousAllocation").toString())); + } + // validate the optional field `RescheduleTracker` + if (jsonObj.getAsJsonObject("RescheduleTracker") != null) { + RescheduleTracker.validateJsonObject(jsonObj.getAsJsonObject("RescheduleTracker")); + } + // validate the optional field `Resources` + if (jsonObj.getAsJsonObject("Resources") != null) { + Resources.validateJsonObject(jsonObj.getAsJsonObject("Resources")); + } + if (jsonObj.get("TaskGroup") != null && !jsonObj.get("TaskGroup").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TaskGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TaskGroup").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Allocation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Allocation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Allocation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Allocation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Allocation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Allocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Allocation + * @throws IOException if the JSON string is invalid with respect to Allocation + */ + public static Allocation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Allocation.class); + } + + /** + * Convert an instance of Allocation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationListStub.java index 99790353..5944244c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationListStub.java @@ -31,6 +31,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * AllocationListStub @@ -137,6 +158,8 @@ public class AllocationListStub { @SerializedName(SERIALIZED_NAME_TASK_STATES) private Map taskStates = null; + public AllocationListStub() { + } public AllocationListStub allocatedResources(AllocatedResources allocatedResources) { @@ -612,7 +635,7 @@ public AllocationListStub preemptedAllocations(List preemptedAllocations public AllocationListStub addPreemptedAllocationsItem(String preemptedAllocationsItem) { if (this.preemptedAllocations == null) { - this.preemptedAllocations = new ArrayList(); + this.preemptedAllocations = new ArrayList<>(); } this.preemptedAllocations.add(preemptedAllocationsItem); return this; @@ -712,7 +735,7 @@ public AllocationListStub taskStates(Map taskStates) { public AllocationListStub putTaskStatesItem(String key, TaskState taskStatesItem) { if (this.taskStates == null) { - this.taskStates = new HashMap(); + this.taskStates = new HashMap<>(); } this.taskStates.put(key, taskStatesItem); return this; @@ -735,6 +758,7 @@ public void setTaskStates(Map taskStates) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -771,11 +795,22 @@ public boolean equals(Object o) { Objects.equals(this.taskStates, allocationListStub.taskStates); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(allocatedResources, clientDescription, clientStatus, createIndex, createTime, deploymentStatus, desiredDescription, desiredStatus, evalID, followupEvalID, ID, jobID, jobType, jobVersion, modifyIndex, modifyTime, name, namespace, nodeID, nodeName, preemptedAllocations, preemptedByAllocation, rescheduleTracker, taskGroup, taskStates); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -820,5 +855,175 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AllocatedResources"); + openapiFields.add("ClientDescription"); + openapiFields.add("ClientStatus"); + openapiFields.add("CreateIndex"); + openapiFields.add("CreateTime"); + openapiFields.add("DeploymentStatus"); + openapiFields.add("DesiredDescription"); + openapiFields.add("DesiredStatus"); + openapiFields.add("EvalID"); + openapiFields.add("FollowupEvalID"); + openapiFields.add("ID"); + openapiFields.add("JobID"); + openapiFields.add("JobType"); + openapiFields.add("JobVersion"); + openapiFields.add("ModifyIndex"); + openapiFields.add("ModifyTime"); + openapiFields.add("Name"); + openapiFields.add("Namespace"); + openapiFields.add("NodeID"); + openapiFields.add("NodeName"); + openapiFields.add("PreemptedAllocations"); + openapiFields.add("PreemptedByAllocation"); + openapiFields.add("RescheduleTracker"); + openapiFields.add("TaskGroup"); + openapiFields.add("TaskStates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocationListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocationListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocationListStub is not found in the empty JSON string", AllocationListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocationListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocationListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `AllocatedResources` + if (jsonObj.getAsJsonObject("AllocatedResources") != null) { + AllocatedResources.validateJsonObject(jsonObj.getAsJsonObject("AllocatedResources")); + } + if (jsonObj.get("ClientDescription") != null && !jsonObj.get("ClientDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientDescription").toString())); + } + if (jsonObj.get("ClientStatus") != null && !jsonObj.get("ClientStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientStatus").toString())); + } + // validate the optional field `DeploymentStatus` + if (jsonObj.getAsJsonObject("DeploymentStatus") != null) { + AllocDeploymentStatus.validateJsonObject(jsonObj.getAsJsonObject("DeploymentStatus")); + } + if (jsonObj.get("DesiredDescription") != null && !jsonObj.get("DesiredDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DesiredDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DesiredDescription").toString())); + } + if (jsonObj.get("DesiredStatus") != null && !jsonObj.get("DesiredStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DesiredStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DesiredStatus").toString())); + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + if (jsonObj.get("FollowupEvalID") != null && !jsonObj.get("FollowupEvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FollowupEvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FollowupEvalID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("JobType") != null && !jsonObj.get("JobType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobType").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + if (jsonObj.get("NodeName") != null && !jsonObj.get("NodeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeName").toString())); + } + // ensure the json data is an array + if (jsonObj.get("PreemptedAllocations") != null && !jsonObj.get("PreemptedAllocations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreemptedAllocations` to be an array in the JSON string but got `%s`", jsonObj.get("PreemptedAllocations").toString())); + } + if (jsonObj.get("PreemptedByAllocation") != null && !jsonObj.get("PreemptedByAllocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PreemptedByAllocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PreemptedByAllocation").toString())); + } + // validate the optional field `RescheduleTracker` + if (jsonObj.getAsJsonObject("RescheduleTracker") != null) { + RescheduleTracker.validateJsonObject(jsonObj.getAsJsonObject("RescheduleTracker")); + } + if (jsonObj.get("TaskGroup") != null && !jsonObj.get("TaskGroup").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TaskGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TaskGroup").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocationListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocationListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocationListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocationListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocationListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocationListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocationListStub + * @throws IOException if the JSON string is invalid with respect to AllocationListStub + */ + public static AllocationListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocationListStub.class); + } + + /** + * Convert an instance of AllocationListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationMetric.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationMetric.java index c59e2a0c..50fa1b6e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationMetric.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AllocationMetric.java @@ -30,6 +30,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AllocationMetric */ @@ -91,6 +111,8 @@ public class AllocationMetric { @SerializedName(SERIALIZED_NAME_SCORES) private Map scores = null; + public AllocationMetric() { + } public AllocationMetric allocationTime(Long allocationTime) { @@ -123,7 +145,7 @@ public AllocationMetric classExhausted(Map classExhausted) { public AllocationMetric putClassExhaustedItem(String key, Integer classExhaustedItem) { if (this.classExhausted == null) { - this.classExhausted = new HashMap(); + this.classExhausted = new HashMap<>(); } this.classExhausted.put(key, classExhaustedItem); return this; @@ -154,7 +176,7 @@ public AllocationMetric classFiltered(Map classFiltered) { public AllocationMetric putClassFilteredItem(String key, Integer classFilteredItem) { if (this.classFiltered == null) { - this.classFiltered = new HashMap(); + this.classFiltered = new HashMap<>(); } this.classFiltered.put(key, classFilteredItem); return this; @@ -208,7 +230,7 @@ public AllocationMetric constraintFiltered(Map constraintFilter public AllocationMetric putConstraintFilteredItem(String key, Integer constraintFilteredItem) { if (this.constraintFiltered == null) { - this.constraintFiltered = new HashMap(); + this.constraintFiltered = new HashMap<>(); } this.constraintFiltered.put(key, constraintFilteredItem); return this; @@ -239,7 +261,7 @@ public AllocationMetric dimensionExhausted(Map dimensionExhaust public AllocationMetric putDimensionExhaustedItem(String key, Integer dimensionExhaustedItem) { if (this.dimensionExhausted == null) { - this.dimensionExhausted = new HashMap(); + this.dimensionExhausted = new HashMap<>(); } this.dimensionExhausted.put(key, dimensionExhaustedItem); return this; @@ -270,7 +292,7 @@ public AllocationMetric nodesAvailable(Map nodesAvailable) { public AllocationMetric putNodesAvailableItem(String key, Integer nodesAvailableItem) { if (this.nodesAvailable == null) { - this.nodesAvailable = new HashMap(); + this.nodesAvailable = new HashMap<>(); } this.nodesAvailable.put(key, nodesAvailableItem); return this; @@ -370,7 +392,7 @@ public AllocationMetric quotaExhausted(List quotaExhausted) { public AllocationMetric addQuotaExhaustedItem(String quotaExhaustedItem) { if (this.quotaExhausted == null) { - this.quotaExhausted = new ArrayList(); + this.quotaExhausted = new ArrayList<>(); } this.quotaExhausted.add(quotaExhaustedItem); return this; @@ -401,7 +423,7 @@ public AllocationMetric resourcesExhausted(Map resourcesExhau public AllocationMetric putResourcesExhaustedItem(String key, Resources resourcesExhaustedItem) { if (this.resourcesExhausted == null) { - this.resourcesExhausted = new HashMap(); + this.resourcesExhausted = new HashMap<>(); } this.resourcesExhausted.put(key, resourcesExhaustedItem); return this; @@ -432,7 +454,7 @@ public AllocationMetric scoreMetaData(List scoreMetaData) { public AllocationMetric addScoreMetaDataItem(NodeScoreMeta scoreMetaDataItem) { if (this.scoreMetaData == null) { - this.scoreMetaData = new ArrayList(); + this.scoreMetaData = new ArrayList<>(); } this.scoreMetaData.add(scoreMetaDataItem); return this; @@ -463,7 +485,7 @@ public AllocationMetric scores(Map scores) { public AllocationMetric putScoresItem(String key, Double scoresItem) { if (this.scores == null) { - this.scores = new HashMap(); + this.scores = new HashMap<>(); } this.scores.put(key, scoresItem); return this; @@ -486,6 +508,7 @@ public void setScores(Map scores) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -549,5 +572,119 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AllocationTime"); + openapiFields.add("ClassExhausted"); + openapiFields.add("ClassFiltered"); + openapiFields.add("CoalescedFailures"); + openapiFields.add("ConstraintFiltered"); + openapiFields.add("DimensionExhausted"); + openapiFields.add("NodesAvailable"); + openapiFields.add("NodesEvaluated"); + openapiFields.add("NodesExhausted"); + openapiFields.add("NodesFiltered"); + openapiFields.add("QuotaExhausted"); + openapiFields.add("ResourcesExhausted"); + openapiFields.add("ScoreMetaData"); + openapiFields.add("Scores"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllocationMetric + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AllocationMetric.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AllocationMetric is not found in the empty JSON string", AllocationMetric.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllocationMetric.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllocationMetric` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("QuotaExhausted") != null && !jsonObj.get("QuotaExhausted").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `QuotaExhausted` to be an array in the JSON string but got `%s`", jsonObj.get("QuotaExhausted").toString())); + } + JsonArray jsonArrayscoreMetaData = jsonObj.getAsJsonArray("ScoreMetaData"); + if (jsonArrayscoreMetaData != null) { + // ensure the json data is an array + if (!jsonObj.get("ScoreMetaData").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ScoreMetaData` to be an array in the JSON string but got `%s`", jsonObj.get("ScoreMetaData").toString())); + } + + // validate the optional field `ScoreMetaData` (array) + for (int i = 0; i < jsonArrayscoreMetaData.size(); i++) { + NodeScoreMeta.validateJsonObject(jsonArrayscoreMetaData.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllocationMetric.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllocationMetric' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllocationMetric.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllocationMetric value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllocationMetric read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllocationMetric given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllocationMetric + * @throws IOException if the JSON string is invalid with respect to AllocationMetric + */ + public static AllocationMetric fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllocationMetric.class); + } + + /** + * Convert an instance of AllocationMetric to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Attribute.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Attribute.java index b307efe0..e58a69b2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Attribute.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Attribute.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Attribute */ @@ -49,6 +69,8 @@ public class Attribute { @SerializedName(SERIALIZED_NAME_UNIT) private String unit; + public Attribute() { + } public Attribute bool(Boolean bool) { @@ -165,6 +187,7 @@ public void setUnit(String unit) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -210,5 +233,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Bool"); + openapiFields.add("Float"); + openapiFields.add("Int"); + openapiFields.add("String"); + openapiFields.add("Unit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Attribute + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Attribute.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Attribute is not found in the empty JSON string", Attribute.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Attribute.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Attribute` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("String") != null && !jsonObj.get("String").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `String` to be a primitive type in the JSON string but got `%s`", jsonObj.get("String").toString())); + } + if (jsonObj.get("Unit") != null && !jsonObj.get("Unit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Unit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Unit").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Attribute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Attribute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Attribute.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Attribute value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Attribute read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Attribute given an JSON string + * + * @param jsonString JSON string + * @return An instance of Attribute + * @throws IOException if the JSON string is invalid with respect to Attribute + */ + public static Attribute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Attribute.class); + } + + /** + * Convert an instance of Attribute to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/AutopilotConfiguration.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/AutopilotConfiguration.java index 471fd535..bc4308fd 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/AutopilotConfiguration.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/AutopilotConfiguration.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * AutopilotConfiguration */ @@ -69,6 +89,8 @@ public class AutopilotConfiguration { @SerializedName(SERIALIZED_NAME_SERVER_STABILIZATION_TIME) private String serverStabilizationTime; + public AutopilotConfiguration() { + } public AutopilotConfiguration cleanupDeadServers(Boolean cleanupDeadServers) { @@ -307,6 +329,7 @@ public void setServerStabilizationTime(String serverStabilizationTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -362,5 +385,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CleanupDeadServers"); + openapiFields.add("CreateIndex"); + openapiFields.add("DisableUpgradeMigration"); + openapiFields.add("EnableCustomUpgrades"); + openapiFields.add("EnableRedundancyZones"); + openapiFields.add("LastContactThreshold"); + openapiFields.add("MaxTrailingLogs"); + openapiFields.add("MinQuorum"); + openapiFields.add("ModifyIndex"); + openapiFields.add("ServerStabilizationTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AutopilotConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AutopilotConfiguration.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AutopilotConfiguration is not found in the empty JSON string", AutopilotConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AutopilotConfiguration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AutopilotConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("LastContactThreshold") != null && !jsonObj.get("LastContactThreshold").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastContactThreshold` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastContactThreshold").toString())); + } + if (jsonObj.get("ServerStabilizationTime") != null && !jsonObj.get("ServerStabilizationTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ServerStabilizationTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ServerStabilizationTime").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AutopilotConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AutopilotConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AutopilotConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AutopilotConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AutopilotConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AutopilotConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of AutopilotConfiguration + * @throws IOException if the JSON string is invalid with respect to AutopilotConfiguration + */ + public static AutopilotConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AutopilotConfiguration.class); + } + + /** + * Convert an instance of AutopilotConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIControllerInfo.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIControllerInfo.java index ab7e902e..49bcdf1a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIControllerInfo.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIControllerInfo.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIControllerInfo */ @@ -77,6 +97,8 @@ public class CSIControllerInfo { @SerializedName(SERIALIZED_NAME_SUPPORTS_READ_ONLY_ATTACH) private Boolean supportsReadOnlyAttach; + public CSIControllerInfo() { + } public CSIControllerInfo supportsAttachDetach(Boolean supportsAttachDetach) { @@ -354,6 +376,7 @@ public void setSupportsReadOnlyAttach(Boolean supportsReadOnlyAttach) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -413,5 +436,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("SupportsAttachDetach"); + openapiFields.add("SupportsClone"); + openapiFields.add("SupportsCondition"); + openapiFields.add("SupportsCreateDelete"); + openapiFields.add("SupportsCreateDeleteSnapshot"); + openapiFields.add("SupportsExpand"); + openapiFields.add("SupportsGet"); + openapiFields.add("SupportsGetCapacity"); + openapiFields.add("SupportsListSnapshots"); + openapiFields.add("SupportsListVolumes"); + openapiFields.add("SupportsListVolumesAttachedNodes"); + openapiFields.add("SupportsReadOnlyAttach"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIControllerInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIControllerInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIControllerInfo is not found in the empty JSON string", CSIControllerInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIControllerInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIControllerInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIControllerInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIControllerInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIControllerInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIControllerInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIControllerInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIControllerInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIControllerInfo + * @throws IOException if the JSON string is invalid with respect to CSIControllerInfo + */ + public static CSIControllerInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIControllerInfo.class); + } + + /** + * Convert an instance of CSIControllerInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIInfo.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIInfo.java index ff56e320..6024182e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIInfo.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIInfo.java @@ -25,7 +25,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * CSIInfo @@ -68,6 +89,8 @@ public class CSIInfo { @SerializedName(SERIALIZED_NAME_UPDATE_TIME) private OffsetDateTime updateTime; + public CSIInfo() { + } public CSIInfo allocID(String allocID) { @@ -276,6 +299,7 @@ public void setUpdateTime(OffsetDateTime updateTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -296,11 +320,22 @@ public boolean equals(Object o) { Objects.equals(this.updateTime, csIInfo.updateTime); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(allocID, controllerInfo, healthDescription, healthy, nodeInfo, pluginID, requiresControllerPlugin, requiresTopologies, updateTime); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -329,5 +364,115 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AllocID"); + openapiFields.add("ControllerInfo"); + openapiFields.add("HealthDescription"); + openapiFields.add("Healthy"); + openapiFields.add("NodeInfo"); + openapiFields.add("PluginID"); + openapiFields.add("RequiresControllerPlugin"); + openapiFields.add("RequiresTopologies"); + openapiFields.add("UpdateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIInfo is not found in the empty JSON string", CSIInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AllocID") != null && !jsonObj.get("AllocID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AllocID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AllocID").toString())); + } + // validate the optional field `ControllerInfo` + if (jsonObj.getAsJsonObject("ControllerInfo") != null) { + CSIControllerInfo.validateJsonObject(jsonObj.getAsJsonObject("ControllerInfo")); + } + if (jsonObj.get("HealthDescription") != null && !jsonObj.get("HealthDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HealthDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HealthDescription").toString())); + } + // validate the optional field `NodeInfo` + if (jsonObj.getAsJsonObject("NodeInfo") != null) { + CSINodeInfo.validateJsonObject(jsonObj.getAsJsonObject("NodeInfo")); + } + if (jsonObj.get("PluginID") != null && !jsonObj.get("PluginID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PluginID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PluginID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIInfo + * @throws IOException if the JSON string is invalid with respect to CSIInfo + */ + public static CSIInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIInfo.class); + } + + /** + * Convert an instance of CSIInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIMountOptions.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIMountOptions.java index 1341980d..d9629b5d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIMountOptions.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIMountOptions.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIMountOptions */ @@ -39,6 +59,8 @@ public class CSIMountOptions { @SerializedName(SERIALIZED_NAME_MOUNT_FLAGS) private List mountFlags = null; + public CSIMountOptions() { + } public CSIMountOptions fsType(String fsType) { @@ -71,7 +93,7 @@ public CSIMountOptions mountFlags(List mountFlags) { public CSIMountOptions addMountFlagsItem(String mountFlagsItem) { if (this.mountFlags == null) { - this.mountFlags = new ArrayList(); + this.mountFlags = new ArrayList<>(); } this.mountFlags.add(mountFlagsItem); return this; @@ -94,6 +116,7 @@ public void setMountFlags(List mountFlags) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -133,5 +156,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("FSType"); + openapiFields.add("MountFlags"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIMountOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIMountOptions.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIMountOptions is not found in the empty JSON string", CSIMountOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIMountOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIMountOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("FSType") != null && !jsonObj.get("FSType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FSType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FSType").toString())); + } + // ensure the json data is an array + if (jsonObj.get("MountFlags") != null && !jsonObj.get("MountFlags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MountFlags` to be an array in the JSON string but got `%s`", jsonObj.get("MountFlags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIMountOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIMountOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIMountOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIMountOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIMountOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIMountOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIMountOptions + * @throws IOException if the JSON string is invalid with respect to CSIMountOptions + */ + public static CSIMountOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIMountOptions.class); + } + + /** + * Convert an instance of CSIMountOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSINodeInfo.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSINodeInfo.java index 53c0a5b5..f31d3a73 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSINodeInfo.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSINodeInfo.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * CSINodeInfo @@ -58,6 +79,8 @@ public class CSINodeInfo { @SerializedName(SERIALIZED_NAME_SUPPORTS_STATS) private Boolean supportsStats; + public CSINodeInfo() { + } public CSINodeInfo accessibleTopology(CSITopology accessibleTopology) { @@ -220,6 +243,7 @@ public void setSupportsStats(Boolean supportsStats) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -238,11 +262,22 @@ public boolean equals(Object o) { Objects.equals(this.supportsStats, csINodeInfo.supportsStats); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessibleTopology, ID, maxVolumes, requiresNodeStageVolume, supportsCondition, supportsExpand, supportsStats); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -269,5 +304,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessibleTopology"); + openapiFields.add("ID"); + openapiFields.add("MaxVolumes"); + openapiFields.add("RequiresNodeStageVolume"); + openapiFields.add("SupportsCondition"); + openapiFields.add("SupportsExpand"); + openapiFields.add("SupportsStats"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSINodeInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSINodeInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSINodeInfo is not found in the empty JSON string", CSINodeInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSINodeInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSINodeInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `AccessibleTopology` + if (jsonObj.getAsJsonObject("AccessibleTopology") != null) { + CSITopology.validateJsonObject(jsonObj.getAsJsonObject("AccessibleTopology")); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSINodeInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSINodeInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSINodeInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSINodeInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSINodeInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSINodeInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSINodeInfo + * @throws IOException if the JSON string is invalid with respect to CSINodeInfo + */ + public static CSINodeInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSINodeInfo.class); + } + + /** + * Convert an instance of CSINodeInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPlugin.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPlugin.java index 15fe9c36..cad56a5a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPlugin.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPlugin.java @@ -30,6 +30,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIPlugin */ @@ -87,6 +107,8 @@ public class CSIPlugin { @SerializedName(SERIALIZED_NAME_VERSION) private String version; + public CSIPlugin() { + } public CSIPlugin allocations(List allocations) { @@ -96,7 +118,7 @@ public CSIPlugin allocations(List allocations) { public CSIPlugin addAllocationsItem(AllocationListStub allocationsItem) { if (this.allocations == null) { - this.allocations = new ArrayList(); + this.allocations = new ArrayList<>(); } this.allocations.add(allocationsItem); return this; @@ -150,7 +172,7 @@ public CSIPlugin controllers(Map controllers) { public CSIPlugin putControllersItem(String key, CSIInfo controllersItem) { if (this.controllers == null) { - this.controllers = new HashMap(); + this.controllers = new HashMap<>(); } this.controllers.put(key, controllersItem); return this; @@ -300,7 +322,7 @@ public CSIPlugin nodes(Map nodes) { public CSIPlugin putNodesItem(String key, CSIInfo nodesItem) { if (this.nodes == null) { - this.nodes = new HashMap(); + this.nodes = new HashMap<>(); } this.nodes.put(key, nodesItem); return this; @@ -415,6 +437,7 @@ public void setVersion(String version) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -476,5 +499,123 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Allocations"); + openapiFields.add("ControllerRequired"); + openapiFields.add("Controllers"); + openapiFields.add("ControllersExpected"); + openapiFields.add("ControllersHealthy"); + openapiFields.add("CreateIndex"); + openapiFields.add("ID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Nodes"); + openapiFields.add("NodesExpected"); + openapiFields.add("NodesHealthy"); + openapiFields.add("Provider"); + openapiFields.add("Version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIPlugin + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIPlugin.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIPlugin is not found in the empty JSON string", CSIPlugin.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIPlugin.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIPlugin` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayallocations = jsonObj.getAsJsonArray("Allocations"); + if (jsonArrayallocations != null) { + // ensure the json data is an array + if (!jsonObj.get("Allocations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Allocations` to be an array in the JSON string but got `%s`", jsonObj.get("Allocations").toString())); + } + + // validate the optional field `Allocations` (array) + for (int i = 0; i < jsonArrayallocations.size(); i++) { + AllocationListStub.validateJsonObject(jsonArrayallocations.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if (jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIPlugin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIPlugin' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIPlugin.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIPlugin value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIPlugin read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIPlugin given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIPlugin + * @throws IOException if the JSON string is invalid with respect to CSIPlugin + */ + public static CSIPlugin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIPlugin.class); + } + + /** + * Convert an instance of CSIPlugin to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPluginListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPluginListStub.java index 1964485c..870f6e10 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPluginListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIPluginListStub.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIPluginListStub */ @@ -65,6 +85,8 @@ public class CSIPluginListStub { @SerializedName(SERIALIZED_NAME_PROVIDER) private String provider; + public CSIPluginListStub() { + } public CSIPluginListStub controllerRequired(Boolean controllerRequired) { @@ -277,6 +299,7 @@ public void setProvider(String provider) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -330,5 +353,104 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ControllerRequired"); + openapiFields.add("ControllersExpected"); + openapiFields.add("ControllersHealthy"); + openapiFields.add("CreateIndex"); + openapiFields.add("ID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("NodesExpected"); + openapiFields.add("NodesHealthy"); + openapiFields.add("Provider"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIPluginListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIPluginListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIPluginListStub is not found in the empty JSON string", CSIPluginListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIPluginListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIPluginListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIPluginListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIPluginListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIPluginListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIPluginListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIPluginListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIPluginListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIPluginListStub + * @throws IOException if the JSON string is invalid with respect to CSIPluginListStub + */ + public static CSIPluginListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIPluginListStub.class); + } + + /** + * Convert an instance of CSIPluginListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshot.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshot.java index 4e0ec947..994b7fce 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshot.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshot.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSISnapshot */ @@ -72,6 +92,8 @@ public class CSISnapshot { @SerializedName(SERIALIZED_NAME_SOURCE_VOLUME_I_D) private String sourceVolumeID; + public CSISnapshot() { + } public CSISnapshot createTime(Long createTime) { @@ -196,7 +218,7 @@ public CSISnapshot parameters(Map parameters) { public CSISnapshot putParametersItem(String key, String parametersItem) { if (this.parameters == null) { - this.parameters = new HashMap(); + this.parameters = new HashMap<>(); } this.parameters.put(key, parametersItem); return this; @@ -250,7 +272,7 @@ public CSISnapshot secrets(Map secrets) { public CSISnapshot putSecretsItem(String key, String secretsItem) { if (this.secrets == null) { - this.secrets = new HashMap(); + this.secrets = new HashMap<>(); } this.secrets.put(key, secretsItem); return this; @@ -319,6 +341,7 @@ public void setSourceVolumeID(String sourceVolumeID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -374,5 +397,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateTime"); + openapiFields.add("ExternalSourceVolumeID"); + openapiFields.add("ID"); + openapiFields.add("IsReady"); + openapiFields.add("Name"); + openapiFields.add("Parameters"); + openapiFields.add("PluginID"); + openapiFields.add("Secrets"); + openapiFields.add("SizeBytes"); + openapiFields.add("SourceVolumeID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSISnapshot + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSISnapshot.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSISnapshot is not found in the empty JSON string", CSISnapshot.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSISnapshot.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSISnapshot` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ExternalSourceVolumeID") != null && !jsonObj.get("ExternalSourceVolumeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalSourceVolumeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalSourceVolumeID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("PluginID") != null && !jsonObj.get("PluginID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PluginID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PluginID").toString())); + } + if (jsonObj.get("SourceVolumeID") != null && !jsonObj.get("SourceVolumeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SourceVolumeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceVolumeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSISnapshot.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSISnapshot' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSISnapshot.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSISnapshot value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSISnapshot read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSISnapshot given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSISnapshot + * @throws IOException if the JSON string is invalid with respect to CSISnapshot + */ + public static CSISnapshot fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSISnapshot.class); + } + + /** + * Convert an instance of CSISnapshot to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateRequest.java index 7ee5df06..4afafa3d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateRequest.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSISnapshotCreateRequest */ @@ -48,6 +68,8 @@ public class CSISnapshotCreateRequest { @SerializedName(SERIALIZED_NAME_SNAPSHOTS) private List snapshots = null; + public CSISnapshotCreateRequest() { + } public CSISnapshotCreateRequest namespace(String namespace) { @@ -126,7 +148,7 @@ public CSISnapshotCreateRequest snapshots(List snapshots) { public CSISnapshotCreateRequest addSnapshotsItem(CSISnapshot snapshotsItem) { if (this.snapshots == null) { - this.snapshots = new ArrayList(); + this.snapshots = new ArrayList<>(); } this.snapshots.add(snapshotsItem); return this; @@ -149,6 +171,7 @@ public void setSnapshots(List snapshots) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -192,5 +215,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("Snapshots"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSISnapshotCreateRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSISnapshotCreateRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSISnapshotCreateRequest is not found in the empty JSON string", CSISnapshotCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSISnapshotCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSISnapshotCreateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + JsonArray jsonArraysnapshots = jsonObj.getAsJsonArray("Snapshots"); + if (jsonArraysnapshots != null) { + // ensure the json data is an array + if (!jsonObj.get("Snapshots").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Snapshots` to be an array in the JSON string but got `%s`", jsonObj.get("Snapshots").toString())); + } + + // validate the optional field `Snapshots` (array) + for (int i = 0; i < jsonArraysnapshots.size(); i++) { + CSISnapshot.validateJsonObject(jsonArraysnapshots.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSISnapshotCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSISnapshotCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSISnapshotCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSISnapshotCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSISnapshotCreateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSISnapshotCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSISnapshotCreateRequest + * @throws IOException if the JSON string is invalid with respect to CSISnapshotCreateRequest + */ + public static CSISnapshotCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSISnapshotCreateRequest.class); + } + + /** + * Convert an instance of CSISnapshotCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateResponse.java index afdf18cb..c7e196f6 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotCreateResponse.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSISnapshotCreateResponse */ @@ -56,6 +76,8 @@ public class CSISnapshotCreateResponse { @SerializedName(SERIALIZED_NAME_SNAPSHOTS) private List snapshots = null; + public CSISnapshotCreateResponse() { + } public CSISnapshotCreateResponse knownLeader(Boolean knownLeader) { @@ -182,7 +204,7 @@ public CSISnapshotCreateResponse snapshots(List snapshots) { public CSISnapshotCreateResponse addSnapshotsItem(CSISnapshot snapshotsItem) { if (this.snapshots == null) { - this.snapshots = new ArrayList(); + this.snapshots = new ArrayList<>(); } this.snapshots.add(snapshotsItem); return this; @@ -205,6 +227,7 @@ public void setSnapshots(List snapshots) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -252,5 +275,110 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("Snapshots"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSISnapshotCreateResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSISnapshotCreateResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSISnapshotCreateResponse is not found in the empty JSON string", CSISnapshotCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSISnapshotCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSISnapshotCreateResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + JsonArray jsonArraysnapshots = jsonObj.getAsJsonArray("Snapshots"); + if (jsonArraysnapshots != null) { + // ensure the json data is an array + if (!jsonObj.get("Snapshots").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Snapshots` to be an array in the JSON string but got `%s`", jsonObj.get("Snapshots").toString())); + } + + // validate the optional field `Snapshots` (array) + for (int i = 0; i < jsonArraysnapshots.size(); i++) { + CSISnapshot.validateJsonObject(jsonArraysnapshots.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSISnapshotCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSISnapshotCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSISnapshotCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSISnapshotCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSISnapshotCreateResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSISnapshotCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSISnapshotCreateResponse + * @throws IOException if the JSON string is invalid with respect to CSISnapshotCreateResponse + */ + public static CSISnapshotCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSISnapshotCreateResponse.class); + } + + /** + * Convert an instance of CSISnapshotCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotListResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotListResponse.java index c102fed1..953fc900 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotListResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSISnapshotListResponse.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSISnapshotListResponse */ @@ -56,6 +76,8 @@ public class CSISnapshotListResponse { @SerializedName(SERIALIZED_NAME_SNAPSHOTS) private List snapshots = null; + public CSISnapshotListResponse() { + } public CSISnapshotListResponse knownLeader(Boolean knownLeader) { @@ -182,7 +204,7 @@ public CSISnapshotListResponse snapshots(List snapshots) { public CSISnapshotListResponse addSnapshotsItem(CSISnapshot snapshotsItem) { if (this.snapshots == null) { - this.snapshots = new ArrayList(); + this.snapshots = new ArrayList<>(); } this.snapshots.add(snapshotsItem); return this; @@ -205,6 +227,7 @@ public void setSnapshots(List snapshots) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -252,5 +275,110 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("Snapshots"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSISnapshotListResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSISnapshotListResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSISnapshotListResponse is not found in the empty JSON string", CSISnapshotListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSISnapshotListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSISnapshotListResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + JsonArray jsonArraysnapshots = jsonObj.getAsJsonArray("Snapshots"); + if (jsonArraysnapshots != null) { + // ensure the json data is an array + if (!jsonObj.get("Snapshots").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Snapshots` to be an array in the JSON string but got `%s`", jsonObj.get("Snapshots").toString())); + } + + // validate the optional field `Snapshots` (array) + for (int i = 0; i < jsonArraysnapshots.size(); i++) { + CSISnapshot.validateJsonObject(jsonArraysnapshots.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSISnapshotListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSISnapshotListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSISnapshotListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSISnapshotListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSISnapshotListResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSISnapshotListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSISnapshotListResponse + * @throws IOException if the JSON string is invalid with respect to CSISnapshotListResponse + */ + public static CSISnapshotListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSISnapshotListResponse.class); + } + + /** + * Convert an instance of CSISnapshotListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopology.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopology.java index 2c2462a0..5ec13d83 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopology.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopology.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSITopology */ @@ -36,6 +56,8 @@ public class CSITopology { @SerializedName(SERIALIZED_NAME_SEGMENTS) private Map segments = null; + public CSITopology() { + } public CSITopology segments(Map segments) { @@ -45,7 +67,7 @@ public CSITopology segments(Map segments) { public CSITopology putSegmentsItem(String key, String segmentsItem) { if (this.segments == null) { - this.segments = new HashMap(); + this.segments = new HashMap<>(); } this.segments.put(key, segmentsItem); return this; @@ -68,6 +90,7 @@ public void setSegments(Map segments) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -105,5 +128,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Segments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSITopology + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSITopology.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSITopology is not found in the empty JSON string", CSITopology.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSITopology.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSITopology` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSITopology.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSITopology' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSITopology.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSITopology value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSITopology read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSITopology given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSITopology + * @throws IOException if the JSON string is invalid with respect to CSITopology + */ + public static CSITopology fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSITopology.class); + } + + /** + * Convert an instance of CSITopology to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopologyRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopologyRequest.java index ef1c9eac..d1c109d3 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopologyRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSITopologyRequest.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSITopologyRequest */ @@ -40,6 +60,8 @@ public class CSITopologyRequest { @SerializedName(SERIALIZED_NAME_REQUIRED) private List required = null; + public CSITopologyRequest() { + } public CSITopologyRequest preferred(List preferred) { @@ -49,7 +71,7 @@ public CSITopologyRequest preferred(List preferred) { public CSITopologyRequest addPreferredItem(CSITopology preferredItem) { if (this.preferred == null) { - this.preferred = new ArrayList(); + this.preferred = new ArrayList<>(); } this.preferred.add(preferredItem); return this; @@ -80,7 +102,7 @@ public CSITopologyRequest required(List required) { public CSITopologyRequest addRequiredItem(CSITopology requiredItem) { if (this.required == null) { - this.required = new ArrayList(); + this.required = new ArrayList<>(); } this.required.add(requiredItem); return this; @@ -103,6 +125,7 @@ public void setRequired(List required) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -142,5 +165,115 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Preferred"); + openapiFields.add("Required"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSITopologyRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSITopologyRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSITopologyRequest is not found in the empty JSON string", CSITopologyRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSITopologyRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSITopologyRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraypreferred = jsonObj.getAsJsonArray("Preferred"); + if (jsonArraypreferred != null) { + // ensure the json data is an array + if (!jsonObj.get("Preferred").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Preferred` to be an array in the JSON string but got `%s`", jsonObj.get("Preferred").toString())); + } + + // validate the optional field `Preferred` (array) + for (int i = 0; i < jsonArraypreferred.size(); i++) { + CSITopology.validateJsonObject(jsonArraypreferred.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArrayrequired = jsonObj.getAsJsonArray("Required"); + if (jsonArrayrequired != null) { + // ensure the json data is an array + if (!jsonObj.get("Required").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Required` to be an array in the JSON string but got `%s`", jsonObj.get("Required").toString())); + } + + // validate the optional field `Required` (array) + for (int i = 0; i < jsonArrayrequired.size(); i++) { + CSITopology.validateJsonObject(jsonArrayrequired.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSITopologyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSITopologyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSITopologyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSITopologyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSITopologyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSITopologyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSITopologyRequest + * @throws IOException if the JSON string is invalid with respect to CSITopologyRequest + */ + public static CSITopologyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSITopologyRequest.class); + } + + /** + * Convert an instance of CSITopologyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolume.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolume.java index 53a4e87f..c10d49bc 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolume.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolume.java @@ -29,11 +29,32 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * CSIVolume @@ -172,6 +193,8 @@ public class CSIVolume { @SerializedName(SERIALIZED_NAME_WRITE_ALLOCS) private Map writeAllocs = null; + public CSIVolume() { + } public CSIVolume accessMode(String accessMode) { @@ -204,7 +227,7 @@ public CSIVolume allocations(List allocations) { public CSIVolume addAllocationsItem(AllocationListStub allocationsItem) { if (this.allocations == null) { - this.allocations = new ArrayList(); + this.allocations = new ArrayList<>(); } this.allocations.add(allocationsItem); return this; @@ -304,7 +327,7 @@ public CSIVolume context(Map context) { public CSIVolume putContextItem(String key, String contextItem) { if (this.context == null) { - this.context = new HashMap(); + this.context = new HashMap<>(); } this.context.put(key, contextItem); return this; @@ -615,7 +638,7 @@ public CSIVolume parameters(Map parameters) { public CSIVolume putParametersItem(String key, String parametersItem) { if (this.parameters == null) { - this.parameters = new HashMap(); + this.parameters = new HashMap<>(); } this.parameters.put(key, parametersItem); return this; @@ -715,7 +738,7 @@ public CSIVolume readAllocs(Map readAllocs) { public CSIVolume putReadAllocsItem(String key, Allocation readAllocsItem) { if (this.readAllocs == null) { - this.readAllocs = new HashMap(); + this.readAllocs = new HashMap<>(); } this.readAllocs.put(key, readAllocsItem); return this; @@ -746,7 +769,7 @@ public CSIVolume requestedCapabilities(List requestedCapabi public CSIVolume addRequestedCapabilitiesItem(CSIVolumeCapability requestedCapabilitiesItem) { if (this.requestedCapabilities == null) { - this.requestedCapabilities = new ArrayList(); + this.requestedCapabilities = new ArrayList<>(); } this.requestedCapabilities.add(requestedCapabilitiesItem); return this; @@ -892,7 +915,7 @@ public CSIVolume secrets(Map secrets) { public CSIVolume putSecretsItem(String key, String secretsItem) { if (this.secrets == null) { - this.secrets = new HashMap(); + this.secrets = new HashMap<>(); } this.secrets.put(key, secretsItem); return this; @@ -946,7 +969,7 @@ public CSIVolume topologies(List topologies) { public CSIVolume addTopologiesItem(CSITopology topologiesItem) { if (this.topologies == null) { - this.topologies = new ArrayList(); + this.topologies = new ArrayList<>(); } this.topologies.add(topologiesItem); return this; @@ -977,7 +1000,7 @@ public CSIVolume writeAllocs(Map writeAllocs) { public CSIVolume putWriteAllocsItem(String key, Allocation writeAllocsItem) { if (this.writeAllocs == null) { - this.writeAllocs = new HashMap(); + this.writeAllocs = new HashMap<>(); } this.writeAllocs.put(key, writeAllocsItem); return this; @@ -1000,6 +1023,7 @@ public void setWriteAllocs(Map writeAllocs) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -1044,11 +1068,22 @@ public boolean equals(Object o) { Objects.equals(this.writeAllocs, csIVolume.writeAllocs); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessMode, allocations, attachmentMode, capacity, cloneID, context, controllerRequired, controllersExpected, controllersHealthy, createIndex, externalID, ID, modifyIndex, mountOptions, name, namespace, nodesExpected, nodesHealthy, parameters, pluginID, provider, providerVersion, readAllocs, requestedCapabilities, requestedCapacityMax, requestedCapacityMin, requestedTopologies, resourceExhausted, schedulable, secrets, snapshotID, topologies, writeAllocs); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1101,5 +1136,199 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessMode"); + openapiFields.add("Allocations"); + openapiFields.add("AttachmentMode"); + openapiFields.add("Capacity"); + openapiFields.add("CloneID"); + openapiFields.add("Context"); + openapiFields.add("ControllerRequired"); + openapiFields.add("ControllersExpected"); + openapiFields.add("ControllersHealthy"); + openapiFields.add("CreateIndex"); + openapiFields.add("ExternalID"); + openapiFields.add("ID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("MountOptions"); + openapiFields.add("Name"); + openapiFields.add("Namespace"); + openapiFields.add("NodesExpected"); + openapiFields.add("NodesHealthy"); + openapiFields.add("Parameters"); + openapiFields.add("PluginID"); + openapiFields.add("Provider"); + openapiFields.add("ProviderVersion"); + openapiFields.add("ReadAllocs"); + openapiFields.add("RequestedCapabilities"); + openapiFields.add("RequestedCapacityMax"); + openapiFields.add("RequestedCapacityMin"); + openapiFields.add("RequestedTopologies"); + openapiFields.add("ResourceExhausted"); + openapiFields.add("Schedulable"); + openapiFields.add("Secrets"); + openapiFields.add("SnapshotID"); + openapiFields.add("Topologies"); + openapiFields.add("WriteAllocs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolume + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolume.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolume is not found in the empty JSON string", CSIVolume.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolume.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolume` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessMode") != null && !jsonObj.get("AccessMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessMode").toString())); + } + JsonArray jsonArrayallocations = jsonObj.getAsJsonArray("Allocations"); + if (jsonArrayallocations != null) { + // ensure the json data is an array + if (!jsonObj.get("Allocations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Allocations` to be an array in the JSON string but got `%s`", jsonObj.get("Allocations").toString())); + } + + // validate the optional field `Allocations` (array) + for (int i = 0; i < jsonArrayallocations.size(); i++) { + AllocationListStub.validateJsonObject(jsonArrayallocations.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("AttachmentMode") != null && !jsonObj.get("AttachmentMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AttachmentMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AttachmentMode").toString())); + } + if (jsonObj.get("CloneID") != null && !jsonObj.get("CloneID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CloneID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CloneID").toString())); + } + if (jsonObj.get("ExternalID") != null && !jsonObj.get("ExternalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `MountOptions` + if (jsonObj.getAsJsonObject("MountOptions") != null) { + CSIMountOptions.validateJsonObject(jsonObj.getAsJsonObject("MountOptions")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("PluginID") != null && !jsonObj.get("PluginID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PluginID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PluginID").toString())); + } + if (jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if (jsonObj.get("ProviderVersion") != null && !jsonObj.get("ProviderVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderVersion").toString())); + } + JsonArray jsonArrayrequestedCapabilities = jsonObj.getAsJsonArray("RequestedCapabilities"); + if (jsonArrayrequestedCapabilities != null) { + // ensure the json data is an array + if (!jsonObj.get("RequestedCapabilities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RequestedCapabilities` to be an array in the JSON string but got `%s`", jsonObj.get("RequestedCapabilities").toString())); + } + + // validate the optional field `RequestedCapabilities` (array) + for (int i = 0; i < jsonArrayrequestedCapabilities.size(); i++) { + CSIVolumeCapability.validateJsonObject(jsonArrayrequestedCapabilities.get(i).getAsJsonObject()); + }; + } + // validate the optional field `RequestedTopologies` + if (jsonObj.getAsJsonObject("RequestedTopologies") != null) { + CSITopologyRequest.validateJsonObject(jsonObj.getAsJsonObject("RequestedTopologies")); + } + if (jsonObj.get("SnapshotID") != null && !jsonObj.get("SnapshotID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SnapshotID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SnapshotID").toString())); + } + JsonArray jsonArraytopologies = jsonObj.getAsJsonArray("Topologies"); + if (jsonArraytopologies != null) { + // ensure the json data is an array + if (!jsonObj.get("Topologies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Topologies` to be an array in the JSON string but got `%s`", jsonObj.get("Topologies").toString())); + } + + // validate the optional field `Topologies` (array) + for (int i = 0; i < jsonArraytopologies.size(); i++) { + CSITopology.validateJsonObject(jsonArraytopologies.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolume.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolume' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolume.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolume value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolume read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolume given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolume + * @throws IOException if the JSON string is invalid with respect to CSIVolume + */ + public static CSIVolume fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolume.class); + } + + /** + * Convert an instance of CSIVolume to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCapability.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCapability.java index 518ad47d..1cbb09c9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCapability.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCapability.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIVolumeCapability */ @@ -37,6 +57,8 @@ public class CSIVolumeCapability { @SerializedName(SERIALIZED_NAME_ATTACHMENT_MODE) private String attachmentMode; + public CSIVolumeCapability() { + } public CSIVolumeCapability accessMode(String accessMode) { @@ -84,6 +106,7 @@ public void setAttachmentMode(String attachmentMode) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,97 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessMode"); + openapiFields.add("AttachmentMode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolumeCapability + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolumeCapability.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolumeCapability is not found in the empty JSON string", CSIVolumeCapability.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolumeCapability.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolumeCapability` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessMode") != null && !jsonObj.get("AccessMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessMode").toString())); + } + if (jsonObj.get("AttachmentMode") != null && !jsonObj.get("AttachmentMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AttachmentMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AttachmentMode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolumeCapability.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolumeCapability' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolumeCapability.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolumeCapability value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolumeCapability read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolumeCapability given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolumeCapability + * @throws IOException if the JSON string is invalid with respect to CSIVolumeCapability + */ + public static CSIVolumeCapability fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolumeCapability.class); + } + + /** + * Convert an instance of CSIVolumeCapability to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCreateRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCreateRequest.java index ff5e1e98..3e29864c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCreateRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeCreateRequest.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIVolumeCreateRequest */ @@ -48,6 +68,8 @@ public class CSIVolumeCreateRequest { @SerializedName(SERIALIZED_NAME_VOLUMES) private List volumes = null; + public CSIVolumeCreateRequest() { + } public CSIVolumeCreateRequest namespace(String namespace) { @@ -126,7 +148,7 @@ public CSIVolumeCreateRequest volumes(List volumes) { public CSIVolumeCreateRequest addVolumesItem(CSIVolume volumesItem) { if (this.volumes == null) { - this.volumes = new ArrayList(); + this.volumes = new ArrayList<>(); } this.volumes.add(volumesItem); return this; @@ -149,6 +171,7 @@ public void setVolumes(List volumes) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -192,5 +215,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("Volumes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolumeCreateRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolumeCreateRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolumeCreateRequest is not found in the empty JSON string", CSIVolumeCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolumeCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolumeCreateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("Volumes"); + if (jsonArrayvolumes != null) { + // ensure the json data is an array + if (!jsonObj.get("Volumes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volumes` to be an array in the JSON string but got `%s`", jsonObj.get("Volumes").toString())); + } + + // validate the optional field `Volumes` (array) + for (int i = 0; i < jsonArrayvolumes.size(); i++) { + CSIVolume.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolumeCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolumeCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolumeCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolumeCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolumeCreateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolumeCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolumeCreateRequest + * @throws IOException if the JSON string is invalid with respect to CSIVolumeCreateRequest + */ + public static CSIVolumeCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolumeCreateRequest.class); + } + + /** + * Convert an instance of CSIVolumeCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeExternalStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeExternalStub.java index 4f249f48..a3164fc9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeExternalStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeExternalStub.java @@ -28,6 +28,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIVolumeExternalStub */ @@ -65,6 +85,8 @@ public class CSIVolumeExternalStub { @SerializedName(SERIALIZED_NAME_VOLUME_CONTEXT) private Map volumeContext = null; + public CSIVolumeExternalStub() { + } public CSIVolumeExternalStub capacityBytes(Long capacityBytes) { @@ -166,7 +188,7 @@ public CSIVolumeExternalStub publishedExternalNodeIDs(List publishedExte public CSIVolumeExternalStub addPublishedExternalNodeIDsItem(String publishedExternalNodeIDsItem) { if (this.publishedExternalNodeIDs == null) { - this.publishedExternalNodeIDs = new ArrayList(); + this.publishedExternalNodeIDs = new ArrayList<>(); } this.publishedExternalNodeIDs.add(publishedExternalNodeIDsItem); return this; @@ -243,7 +265,7 @@ public CSIVolumeExternalStub volumeContext(Map volumeContext) { public CSIVolumeExternalStub putVolumeContextItem(String key, String volumeContextItem) { if (this.volumeContext == null) { - this.volumeContext = new HashMap(); + this.volumeContext = new HashMap<>(); } this.volumeContext.put(key, volumeContextItem); return this; @@ -266,6 +288,7 @@ public void setVolumeContext(Map volumeContext) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -317,5 +340,113 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CapacityBytes"); + openapiFields.add("CloneID"); + openapiFields.add("ExternalID"); + openapiFields.add("IsAbnormal"); + openapiFields.add("PublishedExternalNodeIDs"); + openapiFields.add("SnapshotID"); + openapiFields.add("Status"); + openapiFields.add("VolumeContext"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolumeExternalStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolumeExternalStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolumeExternalStub is not found in the empty JSON string", CSIVolumeExternalStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolumeExternalStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolumeExternalStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("CloneID") != null && !jsonObj.get("CloneID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CloneID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CloneID").toString())); + } + if (jsonObj.get("ExternalID") != null && !jsonObj.get("ExternalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalID").toString())); + } + // ensure the json data is an array + if (jsonObj.get("PublishedExternalNodeIDs") != null && !jsonObj.get("PublishedExternalNodeIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PublishedExternalNodeIDs` to be an array in the JSON string but got `%s`", jsonObj.get("PublishedExternalNodeIDs").toString())); + } + if (jsonObj.get("SnapshotID") != null && !jsonObj.get("SnapshotID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SnapshotID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SnapshotID").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolumeExternalStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolumeExternalStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolumeExternalStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolumeExternalStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolumeExternalStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolumeExternalStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolumeExternalStub + * @throws IOException if the JSON string is invalid with respect to CSIVolumeExternalStub + */ + public static CSIVolumeExternalStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolumeExternalStub.class); + } + + /** + * Convert an instance of CSIVolumeExternalStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListExternalResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListExternalResponse.java index 6d114cc6..f2a73ba8 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListExternalResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListExternalResponse.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIVolumeListExternalResponse */ @@ -40,6 +60,8 @@ public class CSIVolumeListExternalResponse { @SerializedName(SERIALIZED_NAME_VOLUMES) private List volumes = null; + public CSIVolumeListExternalResponse() { + } public CSIVolumeListExternalResponse nextToken(String nextToken) { @@ -72,7 +94,7 @@ public CSIVolumeListExternalResponse volumes(List volumes public CSIVolumeListExternalResponse addVolumesItem(CSIVolumeExternalStub volumesItem) { if (this.volumes == null) { - this.volumes = new ArrayList(); + this.volumes = new ArrayList<>(); } this.volumes.add(volumesItem); return this; @@ -95,6 +117,7 @@ public void setVolumes(List volumes) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -134,5 +157,106 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("NextToken"); + openapiFields.add("Volumes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolumeListExternalResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolumeListExternalResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolumeListExternalResponse is not found in the empty JSON string", CSIVolumeListExternalResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolumeListExternalResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolumeListExternalResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("Volumes"); + if (jsonArrayvolumes != null) { + // ensure the json data is an array + if (!jsonObj.get("Volumes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volumes` to be an array in the JSON string but got `%s`", jsonObj.get("Volumes").toString())); + } + + // validate the optional field `Volumes` (array) + for (int i = 0; i < jsonArrayvolumes.size(); i++) { + CSIVolumeExternalStub.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolumeListExternalResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolumeListExternalResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolumeListExternalResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolumeListExternalResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolumeListExternalResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolumeListExternalResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolumeListExternalResponse + * @throws IOException if the JSON string is invalid with respect to CSIVolumeListExternalResponse + */ + public static CSIVolumeListExternalResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolumeListExternalResponse.class); + } + + /** + * Convert an instance of CSIVolumeListExternalResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListStub.java index 19a9db4a..2bc007fa 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeListStub.java @@ -24,9 +24,30 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * CSIVolumeListStub @@ -105,6 +126,8 @@ public class CSIVolumeListStub { @SerializedName(SERIALIZED_NAME_TOPOLOGIES) private List topologies = null; + public CSIVolumeListStub() { + } public CSIVolumeListStub accessMode(String accessMode) { @@ -509,7 +532,7 @@ public CSIVolumeListStub topologies(List topologies) { public CSIVolumeListStub addTopologiesItem(CSITopology topologiesItem) { if (this.topologies == null) { - this.topologies = new ArrayList(); + this.topologies = new ArrayList<>(); } this.topologies.add(topologiesItem); return this; @@ -532,6 +555,7 @@ public void setTopologies(List topologies) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -561,11 +585,22 @@ public boolean equals(Object o) { Objects.equals(this.topologies, csIVolumeListStub.topologies); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessMode, attachmentMode, controllerRequired, controllersExpected, controllersHealthy, createIndex, externalID, ID, modifyIndex, name, namespace, nodesExpected, nodesHealthy, pluginID, provider, resourceExhausted, schedulable, topologies); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -603,5 +638,143 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessMode"); + openapiFields.add("AttachmentMode"); + openapiFields.add("ControllerRequired"); + openapiFields.add("ControllersExpected"); + openapiFields.add("ControllersHealthy"); + openapiFields.add("CreateIndex"); + openapiFields.add("ExternalID"); + openapiFields.add("ID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("Namespace"); + openapiFields.add("NodesExpected"); + openapiFields.add("NodesHealthy"); + openapiFields.add("PluginID"); + openapiFields.add("Provider"); + openapiFields.add("ResourceExhausted"); + openapiFields.add("Schedulable"); + openapiFields.add("Topologies"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolumeListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolumeListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolumeListStub is not found in the empty JSON string", CSIVolumeListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolumeListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolumeListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessMode") != null && !jsonObj.get("AccessMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessMode").toString())); + } + if (jsonObj.get("AttachmentMode") != null && !jsonObj.get("AttachmentMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AttachmentMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AttachmentMode").toString())); + } + if (jsonObj.get("ExternalID") != null && !jsonObj.get("ExternalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("PluginID") != null && !jsonObj.get("PluginID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PluginID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PluginID").toString())); + } + if (jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + JsonArray jsonArraytopologies = jsonObj.getAsJsonArray("Topologies"); + if (jsonArraytopologies != null) { + // ensure the json data is an array + if (!jsonObj.get("Topologies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Topologies` to be an array in the JSON string but got `%s`", jsonObj.get("Topologies").toString())); + } + + // validate the optional field `Topologies` (array) + for (int i = 0; i < jsonArraytopologies.size(); i++) { + CSITopology.validateJsonObject(jsonArraytopologies.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolumeListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolumeListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolumeListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolumeListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolumeListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolumeListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolumeListStub + * @throws IOException if the JSON string is invalid with respect to CSIVolumeListStub + */ + public static CSIVolumeListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolumeListStub.class); + } + + /** + * Convert an instance of CSIVolumeListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeRegisterRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeRegisterRequest.java index 6db8919d..b02e64e9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeRegisterRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CSIVolumeRegisterRequest.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CSIVolumeRegisterRequest */ @@ -48,6 +68,8 @@ public class CSIVolumeRegisterRequest { @SerializedName(SERIALIZED_NAME_VOLUMES) private List volumes = null; + public CSIVolumeRegisterRequest() { + } public CSIVolumeRegisterRequest namespace(String namespace) { @@ -126,7 +148,7 @@ public CSIVolumeRegisterRequest volumes(List volumes) { public CSIVolumeRegisterRequest addVolumesItem(CSIVolume volumesItem) { if (this.volumes == null) { - this.volumes = new ArrayList(); + this.volumes = new ArrayList<>(); } this.volumes.add(volumesItem); return this; @@ -149,6 +171,7 @@ public void setVolumes(List volumes) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -192,5 +215,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("Volumes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CSIVolumeRegisterRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CSIVolumeRegisterRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CSIVolumeRegisterRequest is not found in the empty JSON string", CSIVolumeRegisterRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CSIVolumeRegisterRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CSIVolumeRegisterRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("Volumes"); + if (jsonArrayvolumes != null) { + // ensure the json data is an array + if (!jsonObj.get("Volumes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volumes` to be an array in the JSON string but got `%s`", jsonObj.get("Volumes").toString())); + } + + // validate the optional field `Volumes` (array) + for (int i = 0; i < jsonArrayvolumes.size(); i++) { + CSIVolume.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CSIVolumeRegisterRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CSIVolumeRegisterRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CSIVolumeRegisterRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CSIVolumeRegisterRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CSIVolumeRegisterRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CSIVolumeRegisterRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CSIVolumeRegisterRequest + * @throws IOException if the JSON string is invalid with respect to CSIVolumeRegisterRequest + */ + public static CSIVolumeRegisterRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CSIVolumeRegisterRequest.class); + } + + /** + * Convert an instance of CSIVolumeRegisterRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/CheckRestart.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/CheckRestart.java index 75c781ed..e32d4704 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/CheckRestart.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/CheckRestart.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * CheckRestart */ @@ -41,6 +61,8 @@ public class CheckRestart { @SerializedName(SERIALIZED_NAME_LIMIT) private Integer limit; + public CheckRestart() { + } public CheckRestart grace(Long grace) { @@ -111,6 +133,7 @@ public void setLimit(Integer limit) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,92 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Grace"); + openapiFields.add("IgnoreWarnings"); + openapiFields.add("Limit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CheckRestart + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CheckRestart.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CheckRestart is not found in the empty JSON string", CheckRestart.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CheckRestart.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckRestart` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CheckRestart.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CheckRestart' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CheckRestart.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CheckRestart value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CheckRestart read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CheckRestart given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckRestart + * @throws IOException if the JSON string is invalid with respect to CheckRestart + */ + public static CheckRestart fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CheckRestart.class); + } + + /** + * Convert an instance of CheckRestart to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Constraint.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Constraint.java index 5714cbc7..d4e4e36d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Constraint.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Constraint.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Constraint */ @@ -41,6 +61,8 @@ public class Constraint { @SerializedName(SERIALIZED_NAME_RTARGET) private String rtarget; + public Constraint() { + } public Constraint ltarget(String ltarget) { @@ -111,6 +133,7 @@ public void setRtarget(String rtarget) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("LTarget"); + openapiFields.add("Operand"); + openapiFields.add("RTarget"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Constraint + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Constraint.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Constraint is not found in the empty JSON string", Constraint.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Constraint.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Constraint` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("LTarget") != null && !jsonObj.get("LTarget").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LTarget").toString())); + } + if (jsonObj.get("Operand") != null && !jsonObj.get("Operand").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operand").toString())); + } + if (jsonObj.get("RTarget") != null && !jsonObj.get("RTarget").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RTarget").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Constraint.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Constraint' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Constraint.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Constraint value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Constraint read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Constraint given an JSON string + * + * @param jsonString JSON string + * @return An instance of Constraint + * @throws IOException if the JSON string is invalid with respect to Constraint + */ + public static Constraint fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Constraint.class); + } + + /** + * Convert an instance of Constraint to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Consul.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Consul.java index 5c33fcdd..aa06a20d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Consul.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Consul.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Consul */ @@ -33,6 +53,8 @@ public class Consul { @SerializedName(SERIALIZED_NAME_NAMESPACE) private String namespace; + public Consul() { + } public Consul namespace(String namespace) { @@ -57,6 +79,7 @@ public void setNamespace(String namespace) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Namespace"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Consul + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Consul.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Consul is not found in the empty JSON string", Consul.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Consul.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Consul` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Consul.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Consul' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Consul.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Consul value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Consul read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Consul given an JSON string + * + * @param jsonString JSON string + * @return An instance of Consul + * @throws IOException if the JSON string is invalid with respect to Consul + */ + public static Consul fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Consul.class); + } + + /** + * Convert an instance of Consul to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulConnect.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulConnect.java index 6667f03d..f2b9846c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulConnect.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulConnect.java @@ -26,6 +26,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ConsulConnect @@ -48,6 +69,8 @@ public class ConsulConnect { @SerializedName(SERIALIZED_NAME_SIDECAR_TASK) private SidecarTask sidecarTask; + public ConsulConnect() { + } public ConsulConnect gateway(ConsulGateway gateway) { @@ -141,6 +164,7 @@ public void setSidecarTask(SidecarTask sidecarTask) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -156,11 +180,22 @@ public boolean equals(Object o) { Objects.equals(this.sidecarTask, consulConnect.sidecarTask); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(gateway, _native, sidecarService, sidecarTask); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -184,5 +219,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Gateway"); + openapiFields.add("Native"); + openapiFields.add("SidecarService"); + openapiFields.add("SidecarTask"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulConnect + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulConnect.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulConnect is not found in the empty JSON string", ConsulConnect.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulConnect.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulConnect` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Gateway` + if (jsonObj.getAsJsonObject("Gateway") != null) { + ConsulGateway.validateJsonObject(jsonObj.getAsJsonObject("Gateway")); + } + // validate the optional field `SidecarService` + if (jsonObj.getAsJsonObject("SidecarService") != null) { + ConsulSidecarService.validateJsonObject(jsonObj.getAsJsonObject("SidecarService")); + } + // validate the optional field `SidecarTask` + if (jsonObj.getAsJsonObject("SidecarTask") != null) { + SidecarTask.validateJsonObject(jsonObj.getAsJsonObject("SidecarTask")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulConnect.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulConnect' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulConnect.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulConnect value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulConnect read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulConnect given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulConnect + * @throws IOException if the JSON string is invalid with respect to ConsulConnect + */ + public static ConsulConnect fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulConnect.class); + } + + /** + * Convert an instance of ConsulConnect to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposeConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposeConfig.java index 90ed963c..1a7f1104 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposeConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposeConfig.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulExposeConfig */ @@ -36,6 +56,8 @@ public class ConsulExposeConfig { @SerializedName(SERIALIZED_NAME_PATH) private List path = null; + public ConsulExposeConfig() { + } public ConsulExposeConfig path(List path) { @@ -45,7 +67,7 @@ public ConsulExposeConfig path(List path) { public ConsulExposeConfig addPathItem(ConsulExposePath pathItem) { if (this.path == null) { - this.path = new ArrayList(); + this.path = new ArrayList<>(); } this.path.add(pathItem); return this; @@ -68,6 +90,7 @@ public void setPath(List path) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -105,5 +128,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Path"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulExposeConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulExposeConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulExposeConfig is not found in the empty JSON string", ConsulExposeConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulExposeConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulExposeConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraypath = jsonObj.getAsJsonArray("Path"); + if (jsonArraypath != null) { + // ensure the json data is an array + if (!jsonObj.get("Path").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Path` to be an array in the JSON string but got `%s`", jsonObj.get("Path").toString())); + } + + // validate the optional field `Path` (array) + for (int i = 0; i < jsonArraypath.size(); i++) { + ConsulExposePath.validateJsonObject(jsonArraypath.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulExposeConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulExposeConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulExposeConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulExposeConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulExposeConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulExposeConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulExposeConfig + * @throws IOException if the JSON string is invalid with respect to ConsulExposeConfig + */ + public static ConsulExposeConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulExposeConfig.class); + } + + /** + * Convert an instance of ConsulExposeConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposePath.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposePath.java index e38d4981..9da3ed9d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposePath.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulExposePath.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulExposePath */ @@ -45,6 +65,8 @@ public class ConsulExposePath { @SerializedName(SERIALIZED_NAME_PROTOCOL) private String protocol; + public ConsulExposePath() { + } public ConsulExposePath listenerPort(String listenerPort) { @@ -138,6 +160,7 @@ public void setProtocol(String protocol) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ListenerPort"); + openapiFields.add("LocalPathPort"); + openapiFields.add("Path"); + openapiFields.add("Protocol"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulExposePath + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulExposePath.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulExposePath is not found in the empty JSON string", ConsulExposePath.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulExposePath.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulExposePath` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ListenerPort") != null && !jsonObj.get("ListenerPort").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ListenerPort` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ListenerPort").toString())); + } + if (jsonObj.get("Path") != null && !jsonObj.get("Path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Path").toString())); + } + if (jsonObj.get("Protocol") != null && !jsonObj.get("Protocol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Protocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Protocol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulExposePath.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulExposePath' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulExposePath.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulExposePath value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulExposePath read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulExposePath given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulExposePath + * @throws IOException if the JSON string is invalid with respect to ConsulExposePath + */ + public static ConsulExposePath fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulExposePath.class); + } + + /** + * Convert an instance of ConsulExposePath to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGateway.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGateway.java index 51b66ab2..1cbfafb4 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGateway.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGateway.java @@ -26,6 +26,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ConsulGateway @@ -48,6 +69,8 @@ public class ConsulGateway { @SerializedName(SERIALIZED_NAME_TERMINATING) private ConsulTerminatingConfigEntry terminating; + public ConsulGateway() { + } public ConsulGateway ingress(ConsulIngressConfigEntry ingress) { @@ -141,6 +164,7 @@ public void setTerminating(ConsulTerminatingConfigEntry terminating) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -156,11 +180,22 @@ public boolean equals(Object o) { Objects.equals(this.terminating, consulGateway.terminating); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(ingress, mesh, proxy, terminating); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -184,5 +219,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Ingress"); + openapiFields.add("Mesh"); + openapiFields.add("Proxy"); + openapiFields.add("Terminating"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulGateway + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulGateway.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulGateway is not found in the empty JSON string", ConsulGateway.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulGateway.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulGateway` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Ingress` + if (jsonObj.getAsJsonObject("Ingress") != null) { + ConsulIngressConfigEntry.validateJsonObject(jsonObj.getAsJsonObject("Ingress")); + } + // validate the optional field `Proxy` + if (jsonObj.getAsJsonObject("Proxy") != null) { + ConsulGatewayProxy.validateJsonObject(jsonObj.getAsJsonObject("Proxy")); + } + // validate the optional field `Terminating` + if (jsonObj.getAsJsonObject("Terminating") != null) { + ConsulTerminatingConfigEntry.validateJsonObject(jsonObj.getAsJsonObject("Terminating")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulGateway.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulGateway' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulGateway.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulGateway value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulGateway read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulGateway given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulGateway + * @throws IOException if the JSON string is invalid with respect to ConsulGateway + */ + public static ConsulGateway fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulGateway.class); + } + + /** + * Convert an instance of ConsulGateway to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayBindAddress.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayBindAddress.java index b0d905ac..9f6167d2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayBindAddress.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayBindAddress.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulGatewayBindAddress */ @@ -41,6 +61,8 @@ public class ConsulGatewayBindAddress { @SerializedName(SERIALIZED_NAME_PORT) private Integer port; + public ConsulGatewayBindAddress() { + } public ConsulGatewayBindAddress address(String address) { @@ -111,6 +133,7 @@ public void setPort(Integer port) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Address"); + openapiFields.add("Name"); + openapiFields.add("Port"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulGatewayBindAddress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulGatewayBindAddress.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulGatewayBindAddress is not found in the empty JSON string", ConsulGatewayBindAddress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulGatewayBindAddress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulGatewayBindAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Address") != null && !jsonObj.get("Address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulGatewayBindAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulGatewayBindAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulGatewayBindAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulGatewayBindAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulGatewayBindAddress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulGatewayBindAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulGatewayBindAddress + * @throws IOException if the JSON string is invalid with respect to ConsulGatewayBindAddress + */ + public static ConsulGatewayBindAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulGatewayBindAddress.class); + } + + /** + * Convert an instance of ConsulGatewayBindAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayProxy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayProxy.java index b533339a..273423eb 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayProxy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayProxy.java @@ -28,6 +28,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulGatewayProxy */ @@ -57,6 +77,8 @@ public class ConsulGatewayProxy { @SerializedName(SERIALIZED_NAME_ENVOY_GATEWAY_NO_DEFAULT_BIND) private Boolean envoyGatewayNoDefaultBind; + public ConsulGatewayProxy() { + } public ConsulGatewayProxy config(Map config) { @@ -66,7 +88,7 @@ public ConsulGatewayProxy config(Map config) { public ConsulGatewayProxy putConfigItem(String key, Object configItem) { if (this.config == null) { - this.config = new HashMap(); + this.config = new HashMap<>(); } this.config.put(key, configItem); return this; @@ -143,7 +165,7 @@ public ConsulGatewayProxy envoyGatewayBindAddresses(Map(); + this.envoyGatewayBindAddresses = new HashMap<>(); } this.envoyGatewayBindAddresses.put(key, envoyGatewayBindAddressesItem); return this; @@ -212,6 +234,7 @@ public void setEnvoyGatewayNoDefaultBind(Boolean envoyGatewayNoDefaultBind) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -259,5 +282,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Config"); + openapiFields.add("ConnectTimeout"); + openapiFields.add("EnvoyDNSDiscoveryType"); + openapiFields.add("EnvoyGatewayBindAddresses"); + openapiFields.add("EnvoyGatewayBindTaggedAddresses"); + openapiFields.add("EnvoyGatewayNoDefaultBind"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulGatewayProxy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulGatewayProxy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulGatewayProxy is not found in the empty JSON string", ConsulGatewayProxy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulGatewayProxy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulGatewayProxy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EnvoyDNSDiscoveryType") != null && !jsonObj.get("EnvoyDNSDiscoveryType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EnvoyDNSDiscoveryType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EnvoyDNSDiscoveryType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulGatewayProxy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulGatewayProxy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulGatewayProxy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulGatewayProxy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulGatewayProxy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulGatewayProxy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulGatewayProxy + * @throws IOException if the JSON string is invalid with respect to ConsulGatewayProxy + */ + public static ConsulGatewayProxy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulGatewayProxy.class); + } + + /** + * Convert an instance of ConsulGatewayProxy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayTLSConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayTLSConfig.java index 1e03a090..5c6153df 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayTLSConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulGatewayTLSConfig.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulGatewayTLSConfig */ @@ -78,7 +98,6 @@ public void setCipherSuites(List cipherSuites) { this.cipherSuites = cipherSuites; } - public ConsulGatewayTLSConfig enabled(Boolean enabled) { this.enabled = enabled; @@ -100,8 +119,7 @@ public Boolean getEnabled() { public void setEnabled(Boolean enabled) { this.enabled = enabled; } - - +ß public ConsulGatewayTLSConfig tlSMaxVersion(String tlSMaxVersion) { this.tlSMaxVersion = tlSMaxVersion; @@ -147,7 +165,6 @@ public void setTlSMinVersion(String tlSMinVersion) { this.tlSMinVersion = tlSMinVersion; } - @Override public boolean equals(Object o) { if (this == o) { @@ -191,5 +208,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulGatewayTLSConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulGatewayTLSConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulGatewayTLSConfig is not found in the empty JSON string", ConsulGatewayTLSConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulGatewayTLSConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulGatewayTLSConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulGatewayTLSConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulGatewayTLSConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulGatewayTLSConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulGatewayTLSConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulGatewayTLSConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulGatewayTLSConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulGatewayTLSConfig + * @throws IOException if the JSON string is invalid with respect to ConsulGatewayTLSConfig + */ + public static ConsulGatewayTLSConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulGatewayTLSConfig.class); + } + + /** + * Convert an instance of ConsulGatewayTLSConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressConfigEntry.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressConfigEntry.java index e0a56194..c090bdc8 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressConfigEntry.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressConfigEntry.java @@ -27,6 +27,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ConsulIngressConfigEntry @@ -41,6 +62,8 @@ public class ConsulIngressConfigEntry { @SerializedName(SERIALIZED_NAME_T_L_S) private ConsulGatewayTLSConfig TLS; + public ConsulIngressConfigEntry() { + } public ConsulIngressConfigEntry listeners(List listeners) { @@ -50,7 +73,7 @@ public ConsulIngressConfigEntry listeners(List listeners) public ConsulIngressConfigEntry addListenersItem(ConsulIngressListener listenersItem) { if (this.listeners == null) { - this.listeners = new ArrayList(); + this.listeners = new ArrayList<>(); } this.listeners.add(listenersItem); return this; @@ -96,6 +119,7 @@ public void setTLS(ConsulGatewayTLSConfig TLS) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -109,11 +133,22 @@ public boolean equals(Object o) { Objects.equals(this.TLS, consulIngressConfigEntry.TLS); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(listeners, TLS); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -135,5 +170,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Listeners"); + openapiFields.add("TLS"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulIngressConfigEntry + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulIngressConfigEntry.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulIngressConfigEntry is not found in the empty JSON string", ConsulIngressConfigEntry.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulIngressConfigEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulIngressConfigEntry` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraylisteners = jsonObj.getAsJsonArray("Listeners"); + if (jsonArraylisteners != null) { + // ensure the json data is an array + if (!jsonObj.get("Listeners").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Listeners` to be an array in the JSON string but got `%s`", jsonObj.get("Listeners").toString())); + } + + // validate the optional field `Listeners` (array) + for (int i = 0; i < jsonArraylisteners.size(); i++) { + ConsulIngressListener.validateJsonObject(jsonArraylisteners.get(i).getAsJsonObject()); + }; + } + // validate the optional field `TLS` + if (jsonObj.getAsJsonObject("TLS") != null) { + ConsulGatewayTLSConfig.validateJsonObject(jsonObj.getAsJsonObject("TLS")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulIngressConfigEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulIngressConfigEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulIngressConfigEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulIngressConfigEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulIngressConfigEntry read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulIngressConfigEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulIngressConfigEntry + * @throws IOException if the JSON string is invalid with respect to ConsulIngressConfigEntry + */ + public static ConsulIngressConfigEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulIngressConfigEntry.class); + } + + /** + * Convert an instance of ConsulIngressConfigEntry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressListener.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressListener.java index 52017f5d..8c41dd35 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressListener.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressListener.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulIngressListener */ @@ -44,6 +64,8 @@ public class ConsulIngressListener { @SerializedName(SERIALIZED_NAME_SERVICES) private List services = null; + public ConsulIngressListener() { + } public ConsulIngressListener port(Integer port) { @@ -99,7 +121,7 @@ public ConsulIngressListener services(List services) { public ConsulIngressListener addServicesItem(ConsulIngressService servicesItem) { if (this.services == null) { - this.services = new ArrayList(); + this.services = new ArrayList<>(); } this.services.add(servicesItem); return this; @@ -122,6 +144,7 @@ public void setServices(List services) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -163,5 +186,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Port"); + openapiFields.add("Protocol"); + openapiFields.add("Services"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulIngressListener + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulIngressListener.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulIngressListener is not found in the empty JSON string", ConsulIngressListener.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulIngressListener.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulIngressListener` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Protocol") != null && !jsonObj.get("Protocol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Protocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Protocol").toString())); + } + JsonArray jsonArrayservices = jsonObj.getAsJsonArray("Services"); + if (jsonArrayservices != null) { + // ensure the json data is an array + if (!jsonObj.get("Services").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Services` to be an array in the JSON string but got `%s`", jsonObj.get("Services").toString())); + } + + // validate the optional field `Services` (array) + for (int i = 0; i < jsonArrayservices.size(); i++) { + ConsulIngressService.validateJsonObject(jsonArrayservices.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulIngressListener.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulIngressListener' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulIngressListener.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulIngressListener value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulIngressListener read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulIngressListener given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulIngressListener + * @throws IOException if the JSON string is invalid with respect to ConsulIngressListener + */ + public static ConsulIngressListener fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulIngressListener.class); + } + + /** + * Convert an instance of ConsulIngressListener to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressService.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressService.java index 42ee7e78..7c24f592 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressService.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulIngressService.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulIngressService */ @@ -39,6 +59,8 @@ public class ConsulIngressService { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public ConsulIngressService() { + } public ConsulIngressService hosts(List hosts) { @@ -48,7 +70,7 @@ public ConsulIngressService hosts(List hosts) { public ConsulIngressService addHostsItem(String hostsItem) { if (this.hosts == null) { - this.hosts = new ArrayList(); + this.hosts = new ArrayList<>(); } this.hosts.add(hostsItem); return this; @@ -94,6 +116,7 @@ public void setName(String name) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -133,5 +156,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Hosts"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulIngressService + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulIngressService.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulIngressService is not found in the empty JSON string", ConsulIngressService.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulIngressService.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulIngressService` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("Hosts") != null && !jsonObj.get("Hosts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Hosts` to be an array in the JSON string but got `%s`", jsonObj.get("Hosts").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulIngressService.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulIngressService' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulIngressService.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulIngressService value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulIngressService read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulIngressService given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulIngressService + * @throws IOException if the JSON string is invalid with respect to ConsulIngressService + */ + public static ConsulIngressService fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulIngressService.class); + } + + /** + * Convert an instance of ConsulIngressService to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulLinkedService.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulLinkedService.java index 2ecffaba..914183d3 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulLinkedService.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulLinkedService.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulLinkedService */ @@ -49,6 +69,8 @@ public class ConsulLinkedService { @SerializedName(SERIALIZED_NAME_S_N_I) private String SNI; + public ConsulLinkedService() { + } public ConsulLinkedService caFile(String caFile) { @@ -165,6 +187,7 @@ public void setSNI(String SNI) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -210,5 +233,109 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CAFile"); + openapiFields.add("CertFile"); + openapiFields.add("KeyFile"); + openapiFields.add("Name"); + openapiFields.add("SNI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulLinkedService + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulLinkedService.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulLinkedService is not found in the empty JSON string", ConsulLinkedService.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulLinkedService.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulLinkedService` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("CAFile") != null && !jsonObj.get("CAFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CAFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CAFile").toString())); + } + if (jsonObj.get("CertFile") != null && !jsonObj.get("CertFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CertFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CertFile").toString())); + } + if (jsonObj.get("KeyFile") != null && !jsonObj.get("KeyFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `KeyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("KeyFile").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("SNI") != null && !jsonObj.get("SNI").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SNI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SNI").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulLinkedService.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulLinkedService' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulLinkedService.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulLinkedService value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulLinkedService read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulLinkedService given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulLinkedService + * @throws IOException if the JSON string is invalid with respect to ConsulLinkedService + */ + public static ConsulLinkedService fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulLinkedService.class); + } + + /** + * Convert an instance of ConsulLinkedService to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulMeshGateway.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulMeshGateway.java index 7d349b46..47bb6ed9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulMeshGateway.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulMeshGateway.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulMeshGateway */ @@ -33,6 +53,8 @@ public class ConsulMeshGateway { @SerializedName(SERIALIZED_NAME_MODE) private String mode; + public ConsulMeshGateway() { + } public ConsulMeshGateway mode(String mode) { @@ -57,6 +79,7 @@ public void setMode(String mode) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Mode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulMeshGateway + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulMeshGateway.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulMeshGateway is not found in the empty JSON string", ConsulMeshGateway.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulMeshGateway.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulMeshGateway` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Mode") != null && !jsonObj.get("Mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Mode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulMeshGateway.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulMeshGateway' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulMeshGateway.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulMeshGateway value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulMeshGateway read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulMeshGateway given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulMeshGateway + * @throws IOException if the JSON string is invalid with respect to ConsulMeshGateway + */ + public static ConsulMeshGateway fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulMeshGateway.class); + } + + /** + * Convert an instance of ConsulMeshGateway to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulProxy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulProxy.java index 8362030b..1d10f865 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulProxy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulProxy.java @@ -29,6 +29,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ConsulProxy @@ -55,6 +76,8 @@ public class ConsulProxy { @SerializedName(SERIALIZED_NAME_UPSTREAMS) private List upstreams = null; + public ConsulProxy() { + } public ConsulProxy config(Map config) { @@ -64,7 +87,7 @@ public ConsulProxy config(Map config) { public ConsulProxy putConfigItem(String key, Object configItem) { if (this.config == null) { - this.config = new HashMap(); + this.config = new HashMap<>(); } this.config.put(key, configItem); return this; @@ -164,7 +187,7 @@ public ConsulProxy upstreams(List upstreams) { public ConsulProxy addUpstreamsItem(ConsulUpstream upstreamsItem) { if (this.upstreams == null) { - this.upstreams = new ArrayList(); + this.upstreams = new ArrayList<>(); } this.upstreams.add(upstreamsItem); return this; @@ -187,6 +210,7 @@ public void setUpstreams(List upstreams) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -203,11 +227,22 @@ public boolean equals(Object o) { Objects.equals(this.upstreams, consulProxy.upstreams); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(config, exposeConfig, localServiceAddress, localServicePort, upstreams); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -232,5 +267,113 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Config"); + openapiFields.add("ExposeConfig"); + openapiFields.add("LocalServiceAddress"); + openapiFields.add("LocalServicePort"); + openapiFields.add("Upstreams"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulProxy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulProxy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulProxy is not found in the empty JSON string", ConsulProxy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulProxy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulProxy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `ExposeConfig` + if (jsonObj.getAsJsonObject("ExposeConfig") != null) { + ConsulExposeConfig.validateJsonObject(jsonObj.getAsJsonObject("ExposeConfig")); + } + if (jsonObj.get("LocalServiceAddress") != null && !jsonObj.get("LocalServiceAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalServiceAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalServiceAddress").toString())); + } + JsonArray jsonArrayupstreams = jsonObj.getAsJsonArray("Upstreams"); + if (jsonArrayupstreams != null) { + // ensure the json data is an array + if (!jsonObj.get("Upstreams").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Upstreams` to be an array in the JSON string but got `%s`", jsonObj.get("Upstreams").toString())); + } + + // validate the optional field `Upstreams` (array) + for (int i = 0; i < jsonArrayupstreams.size(); i++) { + ConsulUpstream.validateJsonObject(jsonArrayupstreams.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulProxy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulProxy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulProxy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulProxy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulProxy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulProxy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulProxy + * @throws IOException if the JSON string is invalid with respect to ConsulProxy + */ + public static ConsulProxy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulProxy.class); + } + + /** + * Convert an instance of ConsulProxy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulSidecarService.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulSidecarService.java index 5d4f977e..a0c6455c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulSidecarService.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulSidecarService.java @@ -26,6 +26,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ConsulSidecarService @@ -48,6 +69,8 @@ public class ConsulSidecarService { @SerializedName(SERIALIZED_NAME_TAGS) private List tags = null; + public ConsulSidecarService() { + } public ConsulSidecarService disableDefaultTCPCheck(Boolean disableDefaultTCPCheck) { @@ -126,7 +149,7 @@ public ConsulSidecarService tags(List tags) { public ConsulSidecarService addTagsItem(String tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; @@ -149,6 +172,7 @@ public void setTags(List tags) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -164,11 +188,22 @@ public boolean equals(Object o) { Objects.equals(this.tags, consulSidecarService.tags); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(disableDefaultTCPCheck, port, proxy, tags); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -192,5 +227,104 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DisableDefaultTCPCheck"); + openapiFields.add("Port"); + openapiFields.add("Proxy"); + openapiFields.add("Tags"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulSidecarService + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulSidecarService.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulSidecarService is not found in the empty JSON string", ConsulSidecarService.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulSidecarService.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulSidecarService` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Port") != null && !jsonObj.get("Port").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Port` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Port").toString())); + } + // validate the optional field `Proxy` + if (jsonObj.getAsJsonObject("Proxy") != null) { + ConsulProxy.validateJsonObject(jsonObj.getAsJsonObject("Proxy")); + } + // ensure the json data is an array + if (jsonObj.get("Tags") != null && !jsonObj.get("Tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Tags` to be an array in the JSON string but got `%s`", jsonObj.get("Tags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulSidecarService.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulSidecarService' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulSidecarService.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulSidecarService value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulSidecarService read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulSidecarService given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulSidecarService + * @throws IOException if the JSON string is invalid with respect to ConsulSidecarService + */ + public static ConsulSidecarService fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulSidecarService.class); + } + + /** + * Convert an instance of ConsulSidecarService to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulTerminatingConfigEntry.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulTerminatingConfigEntry.java index 69049d52..1bba65fd 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulTerminatingConfigEntry.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulTerminatingConfigEntry.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ConsulTerminatingConfigEntry */ @@ -36,6 +56,8 @@ public class ConsulTerminatingConfigEntry { @SerializedName(SERIALIZED_NAME_SERVICES) private List services = null; + public ConsulTerminatingConfigEntry() { + } public ConsulTerminatingConfigEntry services(List services) { @@ -45,7 +67,7 @@ public ConsulTerminatingConfigEntry services(List services) public ConsulTerminatingConfigEntry addServicesItem(ConsulLinkedService servicesItem) { if (this.services == null) { - this.services = new ArrayList(); + this.services = new ArrayList<>(); } this.services.add(servicesItem); return this; @@ -68,6 +90,7 @@ public void setServices(List services) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -105,5 +128,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Services"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulTerminatingConfigEntry + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulTerminatingConfigEntry.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulTerminatingConfigEntry is not found in the empty JSON string", ConsulTerminatingConfigEntry.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulTerminatingConfigEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulTerminatingConfigEntry` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayservices = jsonObj.getAsJsonArray("Services"); + if (jsonArrayservices != null) { + // ensure the json data is an array + if (!jsonObj.get("Services").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Services` to be an array in the JSON string but got `%s`", jsonObj.get("Services").toString())); + } + + // validate the optional field `Services` (array) + for (int i = 0; i < jsonArrayservices.size(); i++) { + ConsulLinkedService.validateJsonObject(jsonArrayservices.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulTerminatingConfigEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulTerminatingConfigEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulTerminatingConfigEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulTerminatingConfigEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulTerminatingConfigEntry read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulTerminatingConfigEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulTerminatingConfigEntry + * @throws IOException if the JSON string is invalid with respect to ConsulTerminatingConfigEntry + */ + public static ConsulTerminatingConfigEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulTerminatingConfigEntry.class); + } + + /** + * Convert an instance of ConsulTerminatingConfigEntry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulUpstream.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulUpstream.java index b41e7c5d..f084246f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulUpstream.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ConsulUpstream.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ConsulUpstream @@ -54,6 +75,8 @@ public class ConsulUpstream { @SerializedName(SERIALIZED_NAME_MESH_GATEWAY) private ConsulMeshGateway meshGateway; + public ConsulUpstream() { + } public ConsulUpstream datacenter(String datacenter) { @@ -193,6 +216,7 @@ public void setMeshGateway(ConsulMeshGateway meshGateway) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -210,11 +234,22 @@ public boolean equals(Object o) { Objects.equals(this.meshGateway, consulUpstream.meshGateway); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(datacenter, destinationName, destinationNamespace, localBindAddress, localBindPort, meshGateway); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -240,5 +275,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Datacenter"); + openapiFields.add("DestinationName"); + openapiFields.add("LocalBindAddress"); + openapiFields.add("LocalBindPort"); + openapiFields.add("MeshGateway"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsulUpstream + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ConsulUpstream.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsulUpstream is not found in the empty JSON string", ConsulUpstream.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsulUpstream.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsulUpstream` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Datacenter") != null && !jsonObj.get("Datacenter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Datacenter").toString())); + } + if (jsonObj.get("DestinationName") != null && !jsonObj.get("DestinationName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DestinationName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DestinationName").toString())); + } + if (jsonObj.get("LocalBindAddress") != null && !jsonObj.get("LocalBindAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalBindAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalBindAddress").toString())); + } + // validate the optional field `MeshGateway` + if (jsonObj.getAsJsonObject("MeshGateway") != null) { + ConsulMeshGateway.validateJsonObject(jsonObj.getAsJsonObject("MeshGateway")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsulUpstream.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsulUpstream' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsulUpstream.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsulUpstream value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsulUpstream read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsulUpstream given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsulUpstream + * @throws IOException if the JSON string is invalid with respect to ConsulUpstream + */ + public static ConsulUpstream fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsulUpstream.class); + } + + /** + * Convert an instance of ConsulUpstream to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DNSConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DNSConfig.java index 30118980..821115db 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DNSConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DNSConfig.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DNSConfig */ @@ -43,6 +63,8 @@ public class DNSConfig { @SerializedName(SERIALIZED_NAME_SERVERS) private List servers = null; + public DNSConfig() { + } public DNSConfig options(List options) { @@ -52,7 +74,7 @@ public DNSConfig options(List options) { public DNSConfig addOptionsItem(String optionsItem) { if (this.options == null) { - this.options = new ArrayList(); + this.options = new ArrayList<>(); } this.options.add(optionsItem); return this; @@ -83,7 +105,7 @@ public DNSConfig searches(List searches) { public DNSConfig addSearchesItem(String searchesItem) { if (this.searches == null) { - this.searches = new ArrayList(); + this.searches = new ArrayList<>(); } this.searches.add(searchesItem); return this; @@ -114,7 +136,7 @@ public DNSConfig servers(List servers) { public DNSConfig addServersItem(String serversItem) { if (this.servers == null) { - this.servers = new ArrayList(); + this.servers = new ArrayList<>(); } this.servers.add(serversItem); return this; @@ -137,6 +159,7 @@ public void setServers(List servers) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -178,5 +201,104 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Options"); + openapiFields.add("Searches"); + openapiFields.add("Servers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DNSConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DNSConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DNSConfig is not found in the empty JSON string", DNSConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DNSConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DNSConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("Options") != null && !jsonObj.get("Options").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Options` to be an array in the JSON string but got `%s`", jsonObj.get("Options").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Searches") != null && !jsonObj.get("Searches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Searches` to be an array in the JSON string but got `%s`", jsonObj.get("Searches").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Servers") != null && !jsonObj.get("Servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Servers` to be an array in the JSON string but got `%s`", jsonObj.get("Servers").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DNSConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DNSConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DNSConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DNSConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DNSConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DNSConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of DNSConfig + * @throws IOException if the JSON string is invalid with respect to DNSConfig + */ + public static DNSConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DNSConfig.class); + } + + /** + * Convert an instance of DNSConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Deployment.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Deployment.java index 9ad5cb93..254b1dd9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Deployment.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Deployment.java @@ -28,6 +28,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Deployment */ @@ -85,6 +105,8 @@ public class Deployment { @SerializedName(SERIALIZED_NAME_TASK_GROUPS) private Map taskGroups = null; + public Deployment() { + } public Deployment createIndex(Integer createIndex) { @@ -382,7 +404,7 @@ public Deployment taskGroups(Map taskGroups) { public Deployment putTaskGroupsItem(String key, DeploymentState taskGroupsItem) { if (this.taskGroups == null) { - this.taskGroups = new HashMap(); + this.taskGroups = new HashMap<>(); } this.taskGroups.put(key, taskGroupsItem); return this; @@ -405,6 +427,7 @@ public void setTaskGroups(Map taskGroups) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -466,5 +489,117 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("ID"); + openapiFields.add("IsMultiregion"); + openapiFields.add("JobCreateIndex"); + openapiFields.add("JobID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("JobSpecModifyIndex"); + openapiFields.add("JobVersion"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Namespace"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("TaskGroups"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Deployment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Deployment.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Deployment is not found in the empty JSON string", Deployment.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Deployment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Deployment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Deployment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Deployment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Deployment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Deployment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Deployment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Deployment given an JSON string + * + * @param jsonString JSON string + * @return An instance of Deployment + * @throws IOException if the JSON string is invalid with respect to Deployment + */ + public static Deployment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Deployment.class); + } + + /** + * Convert an instance of Deployment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentAllocHealthRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentAllocHealthRequest.java index 223f1505..cda9da5c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentAllocHealthRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentAllocHealthRequest.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DeploymentAllocHealthRequest */ @@ -55,6 +75,8 @@ public class DeploymentAllocHealthRequest { @SerializedName(SERIALIZED_NAME_UNHEALTHY_ALLOCATION_I_DS) private List unhealthyAllocationIDs = null; + public DeploymentAllocHealthRequest() { + } public DeploymentAllocHealthRequest deploymentID(String deploymentID) { @@ -87,7 +109,7 @@ public DeploymentAllocHealthRequest healthyAllocationIDs(List healthyAll public DeploymentAllocHealthRequest addHealthyAllocationIDsItem(String healthyAllocationIDsItem) { if (this.healthyAllocationIDs == null) { - this.healthyAllocationIDs = new ArrayList(); + this.healthyAllocationIDs = new ArrayList<>(); } this.healthyAllocationIDs.add(healthyAllocationIDsItem); return this; @@ -187,7 +209,7 @@ public DeploymentAllocHealthRequest unhealthyAllocationIDs(List unhealth public DeploymentAllocHealthRequest addUnhealthyAllocationIDsItem(String unhealthyAllocationIDsItem) { if (this.unhealthyAllocationIDs == null) { - this.unhealthyAllocationIDs = new ArrayList(); + this.unhealthyAllocationIDs = new ArrayList<>(); } this.unhealthyAllocationIDs.add(unhealthyAllocationIDsItem); return this; @@ -210,6 +232,7 @@ public void setUnhealthyAllocationIDs(List unhealthyAllocationIDs) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -257,5 +280,115 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DeploymentID"); + openapiFields.add("HealthyAllocationIDs"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("UnhealthyAllocationIDs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentAllocHealthRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeploymentAllocHealthRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentAllocHealthRequest is not found in the empty JSON string", DeploymentAllocHealthRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentAllocHealthRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentAllocHealthRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + // ensure the json data is an array + if (jsonObj.get("HealthyAllocationIDs") != null && !jsonObj.get("HealthyAllocationIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `HealthyAllocationIDs` to be an array in the JSON string but got `%s`", jsonObj.get("HealthyAllocationIDs").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + // ensure the json data is an array + if (jsonObj.get("UnhealthyAllocationIDs") != null && !jsonObj.get("UnhealthyAllocationIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `UnhealthyAllocationIDs` to be an array in the JSON string but got `%s`", jsonObj.get("UnhealthyAllocationIDs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentAllocHealthRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentAllocHealthRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentAllocHealthRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentAllocHealthRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentAllocHealthRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentAllocHealthRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentAllocHealthRequest + * @throws IOException if the JSON string is invalid with respect to DeploymentAllocHealthRequest + */ + public static DeploymentAllocHealthRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentAllocHealthRequest.class); + } + + /** + * Convert an instance of DeploymentAllocHealthRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPauseRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPauseRequest.java index 946e1f40..81e54864 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPauseRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPauseRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DeploymentPauseRequest */ @@ -49,6 +69,8 @@ public class DeploymentPauseRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public DeploymentPauseRequest() { + } public DeploymentPauseRequest deploymentID(String deploymentID) { @@ -165,6 +187,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -210,5 +233,106 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DeploymentID"); + openapiFields.add("Namespace"); + openapiFields.add("Pause"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentPauseRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeploymentPauseRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentPauseRequest is not found in the empty JSON string", DeploymentPauseRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentPauseRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentPauseRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentPauseRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentPauseRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentPauseRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentPauseRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentPauseRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentPauseRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentPauseRequest + * @throws IOException if the JSON string is invalid with respect to DeploymentPauseRequest + */ + public static DeploymentPauseRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentPauseRequest.class); + } + + /** + * Convert an instance of DeploymentPauseRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPromoteRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPromoteRequest.java index a7181680..c0a3230c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPromoteRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentPromoteRequest.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DeploymentPromoteRequest */ @@ -55,6 +75,8 @@ public class DeploymentPromoteRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public DeploymentPromoteRequest() { + } public DeploymentPromoteRequest all(Boolean all) { @@ -110,7 +132,7 @@ public DeploymentPromoteRequest groups(List groups) { public DeploymentPromoteRequest addGroupsItem(String groupsItem) { if (this.groups == null) { - this.groups = new ArrayList(); + this.groups = new ArrayList<>(); } this.groups.add(groupsItem); return this; @@ -202,6 +224,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -249,5 +272,111 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("All"); + openapiFields.add("DeploymentID"); + openapiFields.add("Groups"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentPromoteRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeploymentPromoteRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentPromoteRequest is not found in the empty JSON string", DeploymentPromoteRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentPromoteRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentPromoteRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Groups") != null && !jsonObj.get("Groups").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Groups` to be an array in the JSON string but got `%s`", jsonObj.get("Groups").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentPromoteRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentPromoteRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentPromoteRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentPromoteRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentPromoteRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentPromoteRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentPromoteRequest + * @throws IOException if the JSON string is invalid with respect to DeploymentPromoteRequest + */ + public static DeploymentPromoteRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentPromoteRequest.class); + } + + /** + * Convert an instance of DeploymentPromoteRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentState.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentState.java index 6d47d7dd..97859396 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentState.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentState.java @@ -23,9 +23,30 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * DeploymentState @@ -72,6 +93,8 @@ public class DeploymentState { @SerializedName(SERIALIZED_NAME_UNHEALTHY_ALLOCS) private Integer unhealthyAllocs; + public DeploymentState() { + } public DeploymentState autoRevert(Boolean autoRevert) { @@ -196,7 +219,7 @@ public DeploymentState placedCanaries(List placedCanaries) { public DeploymentState addPlacedCanariesItem(String placedCanariesItem) { if (this.placedCanaries == null) { - this.placedCanaries = new ArrayList(); + this.placedCanaries = new ArrayList<>(); } this.placedCanaries.add(placedCanariesItem); return this; @@ -311,6 +334,7 @@ public void setUnhealthyAllocs(Integer unhealthyAllocs) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -332,11 +356,22 @@ public boolean equals(Object o) { Objects.equals(this.unhealthyAllocs, deploymentState.unhealthyAllocs); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(autoRevert, desiredCanaries, desiredTotal, healthyAllocs, placedAllocs, placedCanaries, progressDeadline, promoted, requireProgressBy, unhealthyAllocs); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -366,5 +401,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AutoRevert"); + openapiFields.add("DesiredCanaries"); + openapiFields.add("DesiredTotal"); + openapiFields.add("HealthyAllocs"); + openapiFields.add("PlacedAllocs"); + openapiFields.add("PlacedCanaries"); + openapiFields.add("ProgressDeadline"); + openapiFields.add("Promoted"); + openapiFields.add("RequireProgressBy"); + openapiFields.add("UnhealthyAllocs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentState + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeploymentState.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentState is not found in the empty JSON string", DeploymentState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentState` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("PlacedCanaries") != null && !jsonObj.get("PlacedCanaries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacedCanaries` to be an array in the JSON string but got `%s`", jsonObj.get("PlacedCanaries").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentState.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentState value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentState read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentState given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentState + * @throws IOException if the JSON string is invalid with respect to DeploymentState + */ + public static DeploymentState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentState.class); + } + + /** + * Convert an instance of DeploymentState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUnblockRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUnblockRequest.java index 2bdbdb19..8b9f523c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUnblockRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUnblockRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DeploymentUnblockRequest */ @@ -45,6 +65,8 @@ public class DeploymentUnblockRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public DeploymentUnblockRequest() { + } public DeploymentUnblockRequest deploymentID(String deploymentID) { @@ -138,6 +160,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DeploymentID"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentUnblockRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeploymentUnblockRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentUnblockRequest is not found in the empty JSON string", DeploymentUnblockRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentUnblockRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentUnblockRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentUnblockRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentUnblockRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentUnblockRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentUnblockRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentUnblockRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentUnblockRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentUnblockRequest + * @throws IOException if the JSON string is invalid with respect to DeploymentUnblockRequest + */ + public static DeploymentUnblockRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentUnblockRequest.class); + } + + /** + * Convert an instance of DeploymentUnblockRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUpdateResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUpdateResponse.java index d41e1ea5..e4be9b6b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUpdateResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DeploymentUpdateResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DeploymentUpdateResponse */ @@ -53,6 +73,8 @@ public class DeploymentUpdateResponse { @SerializedName(SERIALIZED_NAME_REVERTED_JOB_VERSION) private Integer revertedJobVersion; + public DeploymentUpdateResponse() { + } public DeploymentUpdateResponse deploymentModifyIndex(Integer deploymentModifyIndex) { @@ -200,6 +222,7 @@ public void setRevertedJobVersion(Integer revertedJobVersion) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -247,5 +270,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DeploymentModifyIndex"); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalID"); + openapiFields.add("LastIndex"); + openapiFields.add("RequestTime"); + openapiFields.add("RevertedJobVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentUpdateResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeploymentUpdateResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentUpdateResponse is not found in the empty JSON string", DeploymentUpdateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentUpdateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentUpdateResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentUpdateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentUpdateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentUpdateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentUpdateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentUpdateResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentUpdateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentUpdateResponse + * @throws IOException if the JSON string is invalid with respect to DeploymentUpdateResponse + */ + public static DeploymentUpdateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentUpdateResponse.class); + } + + /** + * Convert an instance of DeploymentUpdateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredTransition.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredTransition.java index 01530089..3decc80b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredTransition.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredTransition.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DesiredTransition */ @@ -37,6 +57,8 @@ public class DesiredTransition { @SerializedName(SERIALIZED_NAME_RESCHEDULE) private Boolean reschedule; + public DesiredTransition() { + } public DesiredTransition migrate(Boolean migrate) { @@ -84,6 +106,7 @@ public void setReschedule(Boolean reschedule) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Migrate"); + openapiFields.add("Reschedule"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DesiredTransition + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DesiredTransition.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DesiredTransition is not found in the empty JSON string", DesiredTransition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DesiredTransition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DesiredTransition` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DesiredTransition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DesiredTransition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DesiredTransition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DesiredTransition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DesiredTransition read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DesiredTransition given an JSON string + * + * @param jsonString JSON string + * @return An instance of DesiredTransition + * @throws IOException if the JSON string is invalid with respect to DesiredTransition + */ + public static DesiredTransition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DesiredTransition.class); + } + + /** + * Convert an instance of DesiredTransition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredUpdates.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredUpdates.java index 67e60136..0eccf600 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredUpdates.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DesiredUpdates.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DesiredUpdates */ @@ -61,6 +81,8 @@ public class DesiredUpdates { @SerializedName(SERIALIZED_NAME_STOP) private Integer stop; + public DesiredUpdates() { + } public DesiredUpdates canary(Integer canary) { @@ -262,6 +284,7 @@ public void setStop(Integer stop) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -313,5 +336,97 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Canary"); + openapiFields.add("DestructiveUpdate"); + openapiFields.add("Ignore"); + openapiFields.add("InPlaceUpdate"); + openapiFields.add("Migrate"); + openapiFields.add("Place"); + openapiFields.add("Preemptions"); + openapiFields.add("Stop"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DesiredUpdates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DesiredUpdates.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DesiredUpdates is not found in the empty JSON string", DesiredUpdates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DesiredUpdates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DesiredUpdates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DesiredUpdates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DesiredUpdates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DesiredUpdates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DesiredUpdates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DesiredUpdates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DesiredUpdates given an JSON string + * + * @param jsonString JSON string + * @return An instance of DesiredUpdates + * @throws IOException if the JSON string is invalid with respect to DesiredUpdates + */ + public static DesiredUpdates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DesiredUpdates.class); + } + + /** + * Convert an instance of DesiredUpdates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DispatchPayloadConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DispatchPayloadConfig.java index 75f4cedc..1b9d6e13 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DispatchPayloadConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DispatchPayloadConfig.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DispatchPayloadConfig */ @@ -31,32 +51,35 @@ public class DispatchPayloadConfig { public static final String SERIALIZED_NAME_FILE = "File"; @SerializedName(SERIALIZED_NAME_FILE) - private String file; + private String _file; + public DispatchPayloadConfig() { + } - public DispatchPayloadConfig file(String file) { + public DispatchPayloadConfig _file(String _file) { - this.file = file; + this._file = _file; return this; } /** - * Get file - * @return file + * Get _file + * @return _file **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getFile() { - return file; + return _file; } - public void setFile(String file) { - this.file = file; + public void setFile(String _file) { + this._file = _file; } + @Override public boolean equals(Object o) { if (this == o) { @@ -66,19 +89,19 @@ public boolean equals(Object o) { return false; } DispatchPayloadConfig dispatchPayloadConfig = (DispatchPayloadConfig) o; - return Objects.equals(this.file, dispatchPayloadConfig.file); + return Objects.equals(this._file, dispatchPayloadConfig._file); } @Override public int hashCode() { - return Objects.hash(file); + return Objects.hash(_file); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DispatchPayloadConfig {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); sb.append("}"); return sb.toString(); } @@ -94,5 +117,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("File"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DispatchPayloadConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DispatchPayloadConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DispatchPayloadConfig is not found in the empty JSON string", DispatchPayloadConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DispatchPayloadConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DispatchPayloadConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("File") != null && !jsonObj.get("File").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `File` to be a primitive type in the JSON string but got `%s`", jsonObj.get("File").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DispatchPayloadConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DispatchPayloadConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DispatchPayloadConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DispatchPayloadConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DispatchPayloadConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DispatchPayloadConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of DispatchPayloadConfig + * @throws IOException if the JSON string is invalid with respect to DispatchPayloadConfig + */ + public static DispatchPayloadConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DispatchPayloadConfig.class); + } + + /** + * Convert an instance of DispatchPayloadConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainMetadata.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainMetadata.java index a29495fe..2651b493 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainMetadata.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainMetadata.java @@ -23,10 +23,31 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * DrainMetadata @@ -53,6 +74,8 @@ public class DrainMetadata { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; + public DrainMetadata() { + } public DrainMetadata accessorID(String accessorID) { @@ -85,7 +108,7 @@ public DrainMetadata meta(Map meta) { public DrainMetadata putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -177,6 +200,7 @@ public void setUpdatedAt(OffsetDateTime updatedAt) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -193,11 +217,22 @@ public boolean equals(Object o) { Objects.equals(this.updatedAt, drainMetadata.updatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessorID, meta, startedAt, status, updatedAt); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -222,5 +257,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessorID"); + openapiFields.add("Meta"); + openapiFields.add("StartedAt"); + openapiFields.add("Status"); + openapiFields.add("UpdatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DrainMetadata + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DrainMetadata.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DrainMetadata is not found in the empty JSON string", DrainMetadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DrainMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DrainMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessorID") != null && !jsonObj.get("AccessorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessorID").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrainMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrainMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrainMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrainMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrainMetadata read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrainMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrainMetadata + * @throws IOException if the JSON string is invalid with respect to DrainMetadata + */ + public static DrainMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrainMetadata.class); + } + + /** + * Convert an instance of DrainMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainSpec.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainSpec.java index a84c9d9b..86b0c37e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainSpec.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainSpec.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * DrainSpec */ @@ -37,6 +57,8 @@ public class DrainSpec { @SerializedName(SERIALIZED_NAME_IGNORE_SYSTEM_JOBS) private Boolean ignoreSystemJobs; + public DrainSpec() { + } public DrainSpec deadline(Long deadline) { @@ -84,6 +106,7 @@ public void setIgnoreSystemJobs(Boolean ignoreSystemJobs) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Deadline"); + openapiFields.add("IgnoreSystemJobs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DrainSpec + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DrainSpec.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DrainSpec is not found in the empty JSON string", DrainSpec.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DrainSpec.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DrainSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrainSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrainSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrainSpec.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrainSpec value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrainSpec read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrainSpec given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrainSpec + * @throws IOException if the JSON string is invalid with respect to DrainSpec + */ + public static DrainSpec fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrainSpec.class); + } + + /** + * Convert an instance of DrainSpec to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainStrategy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainStrategy.java index 461f190f..75d9f256 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainStrategy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DrainStrategy.java @@ -23,7 +23,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * DrainStrategy @@ -46,6 +67,8 @@ public class DrainStrategy { @SerializedName(SERIALIZED_NAME_STARTED_AT) private OffsetDateTime startedAt; + public DrainStrategy() { + } public DrainStrategy deadline(Long deadline) { @@ -139,6 +162,7 @@ public void setStartedAt(OffsetDateTime startedAt) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -154,11 +178,22 @@ public boolean equals(Object o) { Objects.equals(this.startedAt, drainStrategy.startedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(deadline, forceDeadline, ignoreSystemJobs, startedAt); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -182,5 +217,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Deadline"); + openapiFields.add("ForceDeadline"); + openapiFields.add("IgnoreSystemJobs"); + openapiFields.add("StartedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DrainStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DrainStrategy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DrainStrategy is not found in the empty JSON string", DrainStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DrainStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DrainStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrainStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrainStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrainStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrainStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrainStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrainStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrainStrategy + * @throws IOException if the JSON string is invalid with respect to DrainStrategy + */ + public static DrainStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrainStrategy.class); + } + + /** + * Convert an instance of DrainStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/DriverInfo.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/DriverInfo.java index 367ada33..1986fef4 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/DriverInfo.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/DriverInfo.java @@ -23,10 +23,31 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * DriverInfo @@ -53,6 +74,8 @@ public class DriverInfo { @SerializedName(SERIALIZED_NAME_UPDATE_TIME) private OffsetDateTime updateTime; + public DriverInfo() { + } public DriverInfo attributes(Map attributes) { @@ -62,7 +85,7 @@ public DriverInfo attributes(Map attributes) { public DriverInfo putAttributesItem(String key, String attributesItem) { if (this.attributes == null) { - this.attributes = new HashMap(); + this.attributes = new HashMap<>(); } this.attributes.put(key, attributesItem); return this; @@ -177,6 +200,7 @@ public void setUpdateTime(OffsetDateTime updateTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -193,11 +217,22 @@ public boolean equals(Object o) { Objects.equals(this.updateTime, driverInfo.updateTime); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(attributes, detected, healthDescription, healthy, updateTime); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -222,5 +257,97 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Attributes"); + openapiFields.add("Detected"); + openapiFields.add("HealthDescription"); + openapiFields.add("Healthy"); + openapiFields.add("UpdateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DriverInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DriverInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DriverInfo is not found in the empty JSON string", DriverInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DriverInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DriverInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("HealthDescription") != null && !jsonObj.get("HealthDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HealthDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HealthDescription").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DriverInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DriverInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DriverInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DriverInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DriverInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DriverInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of DriverInfo + * @throws IOException if the JSON string is invalid with respect to DriverInfo + */ + public static DriverInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DriverInfo.class); + } + + /** + * Convert an instance of DriverInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/EphemeralDisk.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/EphemeralDisk.java index b3e7d9f7..73ede234 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/EphemeralDisk.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/EphemeralDisk.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * EphemeralDisk */ @@ -41,6 +61,8 @@ public class EphemeralDisk { @SerializedName(SERIALIZED_NAME_STICKY) private Boolean sticky; + public EphemeralDisk() { + } public EphemeralDisk migrate(Boolean migrate) { @@ -111,6 +133,7 @@ public void setSticky(Boolean sticky) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,92 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Migrate"); + openapiFields.add("SizeMB"); + openapiFields.add("Sticky"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EphemeralDisk + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EphemeralDisk.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EphemeralDisk is not found in the empty JSON string", EphemeralDisk.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EphemeralDisk.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EphemeralDisk` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EphemeralDisk.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EphemeralDisk' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EphemeralDisk.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EphemeralDisk value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EphemeralDisk read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EphemeralDisk given an JSON string + * + * @param jsonString JSON string + * @return An instance of EphemeralDisk + * @throws IOException if the JSON string is invalid with respect to EphemeralDisk + */ + public static EphemeralDisk fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EphemeralDisk.class); + } + + /** + * Convert an instance of EphemeralDisk to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/EvalOptions.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/EvalOptions.java index cde516b6..a332e289 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/EvalOptions.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/EvalOptions.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * EvalOptions */ @@ -33,6 +53,8 @@ public class EvalOptions { @SerializedName(SERIALIZED_NAME_FORCE_RESCHEDULE) private Boolean forceReschedule; + public EvalOptions() { + } public EvalOptions forceReschedule(Boolean forceReschedule) { @@ -57,6 +79,7 @@ public void setForceReschedule(Boolean forceReschedule) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ForceReschedule"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvalOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EvalOptions.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EvalOptions is not found in the empty JSON string", EvalOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvalOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvalOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvalOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvalOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvalOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvalOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvalOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvalOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvalOptions + * @throws IOException if the JSON string is invalid with respect to EvalOptions + */ + public static EvalOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvalOptions.class); + } + + /** + * Convert an instance of EvalOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Evaluation.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Evaluation.java index fe92e168..b2264d10 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Evaluation.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Evaluation.java @@ -25,11 +25,32 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Evaluation @@ -152,6 +173,8 @@ public class Evaluation { @SerializedName(SERIALIZED_NAME_WAIT_UNTIL) private OffsetDateTime waitUntil; + public Evaluation() { + } public Evaluation annotatePlan(Boolean annotatePlan) { @@ -207,7 +230,7 @@ public Evaluation classEligibility(Map classEligibility) { public Evaluation putClassEligibilityItem(String key, Boolean classEligibilityItem) { if (this.classEligibility == null) { - this.classEligibility = new HashMap(); + this.classEligibility = new HashMap<>(); } this.classEligibility.put(key, classEligibilityItem); return this; @@ -332,7 +355,7 @@ public Evaluation failedTGAllocs(Map failedTGAllocs) { public Evaluation putFailedTGAllocsItem(String key, AllocationMetric failedTGAllocsItem) { if (this.failedTGAllocs == null) { - this.failedTGAllocs = new HashMap(); + this.failedTGAllocs = new HashMap<>(); } this.failedTGAllocs.put(key, failedTGAllocsItem); return this; @@ -622,7 +645,7 @@ public Evaluation queuedAllocations(Map queuedAllocations) { public Evaluation putQueuedAllocationsItem(String key, Integer queuedAllocationsItem) { if (this.queuedAllocations == null) { - this.queuedAllocations = new HashMap(); + this.queuedAllocations = new HashMap<>(); } this.queuedAllocations.put(key, queuedAllocationsItem); return this; @@ -676,7 +699,7 @@ public Evaluation relatedEvals(List relatedEvals) { public Evaluation addRelatedEvalsItem(EvaluationStub relatedEvalsItem) { if (this.relatedEvals == null) { - this.relatedEvals = new ArrayList(); + this.relatedEvals = new ArrayList<>(); } this.relatedEvals.add(relatedEvalsItem); return this; @@ -862,6 +885,7 @@ public void setWaitUntil(OffsetDateTime waitUntil) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -902,11 +926,22 @@ public boolean equals(Object o) { Objects.equals(this.waitUntil, evaluation.waitUntil); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(annotatePlan, blockedEval, classEligibility, createIndex, createTime, deploymentID, escapedComputedClass, failedTGAllocs, ID, jobID, jobModifyIndex, modifyIndex, modifyTime, namespace, nextEval, nodeID, nodeModifyIndex, previousEval, priority, queuedAllocations, quotaLimitReached, relatedEvals, snapshotIndex, status, statusDescription, triggeredBy, type, wait, waitUntil); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -955,5 +990,169 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AnnotatePlan"); + openapiFields.add("BlockedEval"); + openapiFields.add("ClassEligibility"); + openapiFields.add("CreateIndex"); + openapiFields.add("CreateTime"); + openapiFields.add("DeploymentID"); + openapiFields.add("EscapedComputedClass"); + openapiFields.add("FailedTGAllocs"); + openapiFields.add("ID"); + openapiFields.add("JobID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("ModifyIndex"); + openapiFields.add("ModifyTime"); + openapiFields.add("Namespace"); + openapiFields.add("NextEval"); + openapiFields.add("NodeID"); + openapiFields.add("NodeModifyIndex"); + openapiFields.add("PreviousEval"); + openapiFields.add("Priority"); + openapiFields.add("QueuedAllocations"); + openapiFields.add("QuotaLimitReached"); + openapiFields.add("RelatedEvals"); + openapiFields.add("SnapshotIndex"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("TriggeredBy"); + openapiFields.add("Type"); + openapiFields.add("Wait"); + openapiFields.add("WaitUntil"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Evaluation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Evaluation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Evaluation is not found in the empty JSON string", Evaluation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Evaluation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Evaluation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("BlockedEval") != null && !jsonObj.get("BlockedEval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BlockedEval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BlockedEval").toString())); + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NextEval") != null && !jsonObj.get("NextEval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextEval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextEval").toString())); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + if (jsonObj.get("PreviousEval") != null && !jsonObj.get("PreviousEval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousEval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PreviousEval").toString())); + } + if (jsonObj.get("QuotaLimitReached") != null && !jsonObj.get("QuotaLimitReached").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QuotaLimitReached` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QuotaLimitReached").toString())); + } + JsonArray jsonArrayrelatedEvals = jsonObj.getAsJsonArray("RelatedEvals"); + if (jsonArrayrelatedEvals != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedEvals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedEvals` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedEvals").toString())); + } + + // validate the optional field `RelatedEvals` (array) + for (int i = 0; i < jsonArrayrelatedEvals.size(); i++) { + EvaluationStub.validateJsonObject(jsonArrayrelatedEvals.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + if (jsonObj.get("TriggeredBy") != null && !jsonObj.get("TriggeredBy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TriggeredBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TriggeredBy").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Evaluation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Evaluation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Evaluation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Evaluation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Evaluation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Evaluation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Evaluation + * @throws IOException if the JSON string is invalid with respect to Evaluation + */ + public static Evaluation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Evaluation.class); + } + + /** + * Convert an instance of Evaluation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/EvaluationStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/EvaluationStub.java index b716bfb4..518d67df 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/EvaluationStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/EvaluationStub.java @@ -23,7 +23,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * EvaluationStub @@ -102,6 +123,8 @@ public class EvaluationStub { @SerializedName(SERIALIZED_NAME_WAIT_UNTIL) private OffsetDateTime waitUntil; + public EvaluationStub() { + } public EvaluationStub blockedEval(String blockedEval) { @@ -521,6 +544,7 @@ public void setWaitUntil(OffsetDateTime waitUntil) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -550,11 +574,22 @@ public boolean equals(Object o) { Objects.equals(this.waitUntil, evaluationStub.waitUntil); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(blockedEval, createIndex, createTime, deploymentID, ID, jobID, modifyIndex, modifyTime, namespace, nextEval, nodeID, previousEval, priority, status, statusDescription, triggeredBy, type, waitUntil); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -592,5 +627,143 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("BlockedEval"); + openapiFields.add("CreateIndex"); + openapiFields.add("CreateTime"); + openapiFields.add("DeploymentID"); + openapiFields.add("ID"); + openapiFields.add("JobID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("ModifyTime"); + openapiFields.add("Namespace"); + openapiFields.add("NextEval"); + openapiFields.add("NodeID"); + openapiFields.add("PreviousEval"); + openapiFields.add("Priority"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("TriggeredBy"); + openapiFields.add("Type"); + openapiFields.add("WaitUntil"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvaluationStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EvaluationStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EvaluationStub is not found in the empty JSON string", EvaluationStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvaluationStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvaluationStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("BlockedEval") != null && !jsonObj.get("BlockedEval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BlockedEval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BlockedEval").toString())); + } + if (jsonObj.get("DeploymentID") != null && !jsonObj.get("DeploymentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeploymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeploymentID").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NextEval") != null && !jsonObj.get("NextEval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextEval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextEval").toString())); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + if (jsonObj.get("PreviousEval") != null && !jsonObj.get("PreviousEval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousEval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PreviousEval").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + if (jsonObj.get("TriggeredBy") != null && !jsonObj.get("TriggeredBy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TriggeredBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TriggeredBy").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvaluationStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvaluationStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvaluationStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvaluationStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvaluationStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvaluationStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvaluationStub + * @throws IOException if the JSON string is invalid with respect to EvaluationStub + */ + public static EvaluationStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvaluationStub.class); + } + + /** + * Convert an instance of EvaluationStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/FieldDiff.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/FieldDiff.java index 0ac826c0..0756f772 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/FieldDiff.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/FieldDiff.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * FieldDiff */ @@ -51,6 +71,8 @@ public class FieldDiff { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public FieldDiff() { + } public FieldDiff annotations(List annotations) { @@ -60,7 +82,7 @@ public FieldDiff annotations(List annotations) { public FieldDiff addAnnotationsItem(String annotationsItem) { if (this.annotations == null) { - this.annotations = new ArrayList(); + this.annotations = new ArrayList<>(); } this.annotations.add(annotationsItem); return this; @@ -175,6 +197,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -220,5 +243,110 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Annotations"); + openapiFields.add("Name"); + openapiFields.add("New"); + openapiFields.add("Old"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FieldDiff + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FieldDiff.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FieldDiff is not found in the empty JSON string", FieldDiff.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FieldDiff.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FieldDiff` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("Annotations") != null && !jsonObj.get("Annotations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Annotations` to be an array in the JSON string but got `%s`", jsonObj.get("Annotations").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("New") != null && !jsonObj.get("New").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `New` to be a primitive type in the JSON string but got `%s`", jsonObj.get("New").toString())); + } + if (jsonObj.get("Old") != null && !jsonObj.get("Old").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Old` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Old").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FieldDiff.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FieldDiff' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FieldDiff.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FieldDiff value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FieldDiff read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FieldDiff given an JSON string + * + * @param jsonString JSON string + * @return An instance of FieldDiff + * @throws IOException if the JSON string is invalid with respect to FieldDiff + */ + public static FieldDiff fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FieldDiff.class); + } + + /** + * Convert an instance of FieldDiff to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzyMatch.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzyMatch.java index 4be39fe5..2dd1a379 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzyMatch.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzyMatch.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * FuzzyMatch */ @@ -39,6 +59,8 @@ public class FuzzyMatch { @SerializedName(SERIALIZED_NAME_SCOPE) private List scope = null; + public FuzzyMatch() { + } public FuzzyMatch ID(String ID) { @@ -71,7 +93,7 @@ public FuzzyMatch scope(List scope) { public FuzzyMatch addScopeItem(String scopeItem) { if (this.scope == null) { - this.scope = new ArrayList(); + this.scope = new ArrayList<>(); } this.scope.add(scopeItem); return this; @@ -94,6 +116,7 @@ public void setScope(List scope) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -133,5 +156,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("Scope"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FuzzyMatch + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FuzzyMatch.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FuzzyMatch is not found in the empty JSON string", FuzzyMatch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FuzzyMatch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FuzzyMatch` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Scope") != null && !jsonObj.get("Scope").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Scope` to be an array in the JSON string but got `%s`", jsonObj.get("Scope").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FuzzyMatch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FuzzyMatch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FuzzyMatch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FuzzyMatch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FuzzyMatch read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FuzzyMatch given an JSON string + * + * @param jsonString JSON string + * @return An instance of FuzzyMatch + * @throws IOException if the JSON string is invalid with respect to FuzzyMatch + */ + public static FuzzyMatch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FuzzyMatch.class); + } + + /** + * Convert an instance of FuzzyMatch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchRequest.java index 113de303..47b61c49 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchRequest.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * FuzzySearchRequest */ @@ -92,6 +112,8 @@ public class FuzzySearchRequest { @SerializedName(SERIALIZED_NAME_WAIT_TIME) private Long waitTime; + public FuzzySearchRequest() { + } public FuzzySearchRequest allowStale(Boolean allowStale) { @@ -193,7 +215,7 @@ public FuzzySearchRequest headers(Map headers) { public FuzzySearchRequest putHeadersItem(String key, String headersItem) { if (this.headers == null) { - this.headers = new HashMap(); + this.headers = new HashMap<>(); } this.headers.put(key, headersItem); return this; @@ -270,7 +292,7 @@ public FuzzySearchRequest params(Map params) { public FuzzySearchRequest putParamsItem(String key, String paramsItem) { if (this.params == null) { - this.params = new HashMap(); + this.params = new HashMap<>(); } this.params.put(key, paramsItem); return this; @@ -456,6 +478,7 @@ public void setWaitTime(Long waitTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -521,5 +544,128 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AllowStale"); + openapiFields.add("AuthToken"); + openapiFields.add("Context"); + openapiFields.add("Filter"); + openapiFields.add("Headers"); + openapiFields.add("Namespace"); + openapiFields.add("NextToken"); + openapiFields.add("Params"); + openapiFields.add("PerPage"); + openapiFields.add("Prefix"); + openapiFields.add("Region"); + openapiFields.add("Reverse"); + openapiFields.add("Text"); + openapiFields.add("WaitIndex"); + openapiFields.add("WaitTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FuzzySearchRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FuzzySearchRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FuzzySearchRequest is not found in the empty JSON string", FuzzySearchRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FuzzySearchRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FuzzySearchRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AuthToken") != null && !jsonObj.get("AuthToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthToken").toString())); + } + if (jsonObj.get("Context") != null && !jsonObj.get("Context").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Context` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Context").toString())); + } + if (jsonObj.get("Filter") != null && !jsonObj.get("Filter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Filter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Filter").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + if (jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("Text") != null && !jsonObj.get("Text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FuzzySearchRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FuzzySearchRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FuzzySearchRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FuzzySearchRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FuzzySearchRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FuzzySearchRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FuzzySearchRequest + * @throws IOException if the JSON string is invalid with respect to FuzzySearchRequest + */ + public static FuzzySearchRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FuzzySearchRequest.class); + } + + /** + * Convert an instance of FuzzySearchRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchResponse.java index a7ee632c..5bca3b5b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/FuzzySearchResponse.java @@ -28,6 +28,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * FuzzySearchResponse */ @@ -61,6 +81,8 @@ public class FuzzySearchResponse { @SerializedName(SERIALIZED_NAME_TRUNCATIONS) private Map truncations = null; + public FuzzySearchResponse() { + } public FuzzySearchResponse knownLeader(Boolean knownLeader) { @@ -141,7 +163,7 @@ public FuzzySearchResponse matches(Map> matches) { public FuzzySearchResponse putMatchesItem(String key, List matchesItem) { if (this.matches == null) { - this.matches = new HashMap>(); + this.matches = new HashMap<>(); } this.matches.put(key, matchesItem); return this; @@ -218,7 +240,7 @@ public FuzzySearchResponse truncations(Map truncations) { public FuzzySearchResponse putTruncationsItem(String key, Boolean truncationsItem) { if (this.truncations == null) { - this.truncations = new HashMap(); + this.truncations = new HashMap<>(); } this.truncations.put(key, truncationsItem); return this; @@ -241,6 +263,7 @@ public void setTruncations(Map truncations) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -290,5 +313,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("Matches"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("Truncations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FuzzySearchResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FuzzySearchResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FuzzySearchResponse is not found in the empty JSON string", FuzzySearchResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FuzzySearchResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FuzzySearchResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FuzzySearchResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FuzzySearchResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FuzzySearchResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FuzzySearchResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FuzzySearchResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FuzzySearchResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FuzzySearchResponse + * @throws IOException if the JSON string is invalid with respect to FuzzySearchResponse + */ + public static FuzzySearchResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FuzzySearchResponse.class); + } + + /** + * Convert an instance of FuzzySearchResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/GaugeValue.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/GaugeValue.java index 64ecf37e..4847f210 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/GaugeValue.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/GaugeValue.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * GaugeValue */ @@ -44,6 +64,8 @@ public class GaugeValue { @SerializedName(SERIALIZED_NAME_VALUE) private Float value; + public GaugeValue() { + } public GaugeValue labels(Map labels) { @@ -53,7 +75,7 @@ public GaugeValue labels(Map labels) { public GaugeValue putLabelsItem(String key, String labelsItem) { if (this.labels == null) { - this.labels = new HashMap(); + this.labels = new HashMap<>(); } this.labels.put(key, labelsItem); return this; @@ -122,6 +144,7 @@ public void setValue(Float value) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -163,5 +186,95 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Labels"); + openapiFields.add("Name"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GaugeValue + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GaugeValue.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GaugeValue is not found in the empty JSON string", GaugeValue.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GaugeValue.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GaugeValue` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GaugeValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GaugeValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GaugeValue.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GaugeValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GaugeValue read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GaugeValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of GaugeValue + * @throws IOException if the JSON string is invalid with respect to GaugeValue + */ + public static GaugeValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GaugeValue.class); + } + + /** + * Convert an instance of GaugeValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/HostNetworkInfo.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/HostNetworkInfo.java index 67f92add..03c4b590 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/HostNetworkInfo.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/HostNetworkInfo.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * HostNetworkInfo */ @@ -45,6 +65,8 @@ public class HostNetworkInfo { @SerializedName(SERIALIZED_NAME_RESERVED_PORTS) private String reservedPorts; + public HostNetworkInfo() { + } public HostNetworkInfo CIDR(String CIDR) { @@ -138,6 +160,7 @@ public void setReservedPorts(String reservedPorts) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CIDR"); + openapiFields.add("Interface"); + openapiFields.add("Name"); + openapiFields.add("ReservedPorts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HostNetworkInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HostNetworkInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HostNetworkInfo is not found in the empty JSON string", HostNetworkInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HostNetworkInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HostNetworkInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("CIDR") != null && !jsonObj.get("CIDR").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CIDR` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CIDR").toString())); + } + if (jsonObj.get("Interface") != null && !jsonObj.get("Interface").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Interface` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Interface").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("ReservedPorts") != null && !jsonObj.get("ReservedPorts").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ReservedPorts` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ReservedPorts").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HostNetworkInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HostNetworkInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HostNetworkInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HostNetworkInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HostNetworkInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HostNetworkInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of HostNetworkInfo + * @throws IOException if the JSON string is invalid with respect to HostNetworkInfo + */ + public static HostNetworkInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HostNetworkInfo.class); + } + + /** + * Convert an instance of HostNetworkInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/HostVolumeInfo.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/HostVolumeInfo.java index 87470f9f..f79fd78a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/HostVolumeInfo.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/HostVolumeInfo.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * HostVolumeInfo */ @@ -37,6 +57,8 @@ public class HostVolumeInfo { @SerializedName(SERIALIZED_NAME_READ_ONLY) private Boolean readOnly; + public HostVolumeInfo() { + } public HostVolumeInfo path(String path) { @@ -84,6 +106,7 @@ public void setReadOnly(Boolean readOnly) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Path"); + openapiFields.add("ReadOnly"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HostVolumeInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HostVolumeInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HostVolumeInfo is not found in the empty JSON string", HostVolumeInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HostVolumeInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HostVolumeInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Path") != null && !jsonObj.get("Path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HostVolumeInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HostVolumeInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HostVolumeInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HostVolumeInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HostVolumeInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HostVolumeInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of HostVolumeInfo + * @throws IOException if the JSON string is invalid with respect to HostVolumeInfo + */ + public static HostVolumeInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HostVolumeInfo.class); + } + + /** + * Convert an instance of HostVolumeInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Job.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Job.java index 6cf0977a..e813c6f8 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Job.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Job.java @@ -37,6 +37,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Job @@ -191,6 +212,8 @@ public class Job { @SerializedName(SERIALIZED_NAME_VERSION) private Integer version; + public Job() { + } public Job affinities(List affinities) { @@ -200,7 +223,7 @@ public Job affinities(List affinities) { public Job addAffinitiesItem(Affinity affinitiesItem) { if (this.affinities == null) { - this.affinities = new ArrayList(); + this.affinities = new ArrayList<>(); } this.affinities.add(affinitiesItem); return this; @@ -254,7 +277,7 @@ public Job constraints(List constraints) { public Job addConstraintsItem(Constraint constraintsItem) { if (this.constraints == null) { - this.constraints = new ArrayList(); + this.constraints = new ArrayList<>(); } this.constraints.add(constraintsItem); return this; @@ -356,7 +379,7 @@ public Job datacenters(List datacenters) { public Job addDatacentersItem(String datacentersItem) { if (this.datacenters == null) { - this.datacenters = new ArrayList(); + this.datacenters = new ArrayList<>(); } this.datacenters.add(datacentersItem); return this; @@ -481,7 +504,7 @@ public Job meta(Map meta) { public Job putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -813,7 +836,7 @@ public Job spreads(List spreads) { public Job addSpreadsItem(Spread spreadsItem) { if (this.spreads == null) { - this.spreads = new ArrayList(); + this.spreads = new ArrayList<>(); } this.spreads.add(spreadsItem); return this; @@ -959,7 +982,7 @@ public Job taskGroups(List taskGroups) { public Job addTaskGroupsItem(TaskGroup taskGroupsItem) { if (this.taskGroups == null) { - this.taskGroups = new ArrayList(); + this.taskGroups = new ArrayList<>(); } this.taskGroups.add(taskGroupsItem); return this; @@ -1099,6 +1122,7 @@ public void setVersion(Integer version) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -1147,11 +1171,22 @@ public boolean equals(Object o) { Objects.equals(this.version, job.version); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(affinities, allAtOnce, constraints, consulNamespace, consulToken, createIndex, datacenters, dispatchIdempotencyToken, dispatched, ID, jobModifyIndex, meta, migrate, modifyIndex, multiregion, name, namespace, nomadTokenID, parameterizedJob, parentID, Arrays.hashCode(payload), periodic, priority, region, reschedule, spreads, stable, status, statusDescription, stop, submitTime, taskGroups, type, update, vaultNamespace, vaultToken, version); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1208,5 +1243,244 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Affinities"); + openapiFields.add("AllAtOnce"); + openapiFields.add("Constraints"); + openapiFields.add("ConsulNamespace"); + openapiFields.add("ConsulToken"); + openapiFields.add("CreateIndex"); + openapiFields.add("Datacenters"); + openapiFields.add("DispatchIdempotencyToken"); + openapiFields.add("Dispatched"); + openapiFields.add("ID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("Meta"); + openapiFields.add("Migrate"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Multiregion"); + openapiFields.add("Name"); + openapiFields.add("Namespace"); + openapiFields.add("NomadTokenID"); + openapiFields.add("ParameterizedJob"); + openapiFields.add("ParentID"); + openapiFields.add("Payload"); + openapiFields.add("Periodic"); + openapiFields.add("Priority"); + openapiFields.add("Region"); + openapiFields.add("Reschedule"); + openapiFields.add("Spreads"); + openapiFields.add("Stable"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("Stop"); + openapiFields.add("SubmitTime"); + openapiFields.add("TaskGroups"); + openapiFields.add("Type"); + openapiFields.add("Update"); + openapiFields.add("VaultNamespace"); + openapiFields.add("VaultToken"); + openapiFields.add("Version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Job + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Job.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Job is not found in the empty JSON string", Job.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Job.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Job` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayaffinities = jsonObj.getAsJsonArray("Affinities"); + if (jsonArrayaffinities != null) { + // ensure the json data is an array + if (!jsonObj.get("Affinities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Affinities` to be an array in the JSON string but got `%s`", jsonObj.get("Affinities").toString())); + } + + // validate the optional field `Affinities` (array) + for (int i = 0; i < jsonArrayaffinities.size(); i++) { + Affinity.validateJsonObject(jsonArrayaffinities.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArrayconstraints = jsonObj.getAsJsonArray("Constraints"); + if (jsonArrayconstraints != null) { + // ensure the json data is an array + if (!jsonObj.get("Constraints").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Constraints` to be an array in the JSON string but got `%s`", jsonObj.get("Constraints").toString())); + } + + // validate the optional field `Constraints` (array) + for (int i = 0; i < jsonArrayconstraints.size(); i++) { + Constraint.validateJsonObject(jsonArrayconstraints.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("ConsulNamespace") != null && !jsonObj.get("ConsulNamespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsulNamespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsulNamespace").toString())); + } + if (jsonObj.get("ConsulToken") != null && !jsonObj.get("ConsulToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsulToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsulToken").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Datacenters") != null && !jsonObj.get("Datacenters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenters` to be an array in the JSON string but got `%s`", jsonObj.get("Datacenters").toString())); + } + if (jsonObj.get("DispatchIdempotencyToken") != null && !jsonObj.get("DispatchIdempotencyToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DispatchIdempotencyToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DispatchIdempotencyToken").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `Migrate` + if (jsonObj.getAsJsonObject("Migrate") != null) { + MigrateStrategy.validateJsonObject(jsonObj.getAsJsonObject("Migrate")); + } + // validate the optional field `Multiregion` + if (jsonObj.getAsJsonObject("Multiregion") != null) { + Multiregion.validateJsonObject(jsonObj.getAsJsonObject("Multiregion")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NomadTokenID") != null && !jsonObj.get("NomadTokenID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NomadTokenID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NomadTokenID").toString())); + } + // validate the optional field `ParameterizedJob` + if (jsonObj.getAsJsonObject("ParameterizedJob") != null) { + ParameterizedJobConfig.validateJsonObject(jsonObj.getAsJsonObject("ParameterizedJob")); + } + if (jsonObj.get("ParentID") != null && !jsonObj.get("ParentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ParentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ParentID").toString())); + } + // validate the optional field `Periodic` + if (jsonObj.getAsJsonObject("Periodic") != null) { + PeriodicConfig.validateJsonObject(jsonObj.getAsJsonObject("Periodic")); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + // validate the optional field `Reschedule` + if (jsonObj.getAsJsonObject("Reschedule") != null) { + ReschedulePolicy.validateJsonObject(jsonObj.getAsJsonObject("Reschedule")); + } + JsonArray jsonArrayspreads = jsonObj.getAsJsonArray("Spreads"); + if (jsonArrayspreads != null) { + // ensure the json data is an array + if (!jsonObj.get("Spreads").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Spreads` to be an array in the JSON string but got `%s`", jsonObj.get("Spreads").toString())); + } + + // validate the optional field `Spreads` (array) + for (int i = 0; i < jsonArrayspreads.size(); i++) { + Spread.validateJsonObject(jsonArrayspreads.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + JsonArray jsonArraytaskGroups = jsonObj.getAsJsonArray("TaskGroups"); + if (jsonArraytaskGroups != null) { + // ensure the json data is an array + if (!jsonObj.get("TaskGroups").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TaskGroups` to be an array in the JSON string but got `%s`", jsonObj.get("TaskGroups").toString())); + } + + // validate the optional field `TaskGroups` (array) + for (int i = 0; i < jsonArraytaskGroups.size(); i++) { + TaskGroup.validateJsonObject(jsonArraytaskGroups.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + // validate the optional field `Update` + if (jsonObj.getAsJsonObject("Update") != null) { + UpdateStrategy.validateJsonObject(jsonObj.getAsJsonObject("Update")); + } + if (jsonObj.get("VaultNamespace") != null && !jsonObj.get("VaultNamespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VaultNamespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VaultNamespace").toString())); + } + if (jsonObj.get("VaultToken") != null && !jsonObj.get("VaultToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VaultToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VaultToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Job.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Job' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Job.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Job value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Job read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Job given an JSON string + * + * @param jsonString JSON string + * @return An instance of Job + * @throws IOException if the JSON string is invalid with respect to Job + */ + public static Job fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Job.class); + } + + /** + * Convert an instance of Job to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobChildrenSummary.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobChildrenSummary.java index af02e83e..a48c3a75 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobChildrenSummary.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobChildrenSummary.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobChildrenSummary */ @@ -41,6 +61,8 @@ public class JobChildrenSummary { @SerializedName(SERIALIZED_NAME_RUNNING) private Long running; + public JobChildrenSummary() { + } public JobChildrenSummary dead(Long dead) { @@ -111,6 +133,7 @@ public void setRunning(Long running) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,92 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Dead"); + openapiFields.add("Pending"); + openapiFields.add("Running"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobChildrenSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobChildrenSummary.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobChildrenSummary is not found in the empty JSON string", JobChildrenSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobChildrenSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobChildrenSummary` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobChildrenSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobChildrenSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobChildrenSummary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobChildrenSummary value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobChildrenSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobChildrenSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobChildrenSummary + * @throws IOException if the JSON string is invalid with respect to JobChildrenSummary + */ + public static JobChildrenSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobChildrenSummary.class); + } + + /** + * Convert an instance of JobChildrenSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDeregisterResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDeregisterResponse.java index d13f3521..5b78ca56 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDeregisterResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDeregisterResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobDeregisterResponse */ @@ -61,6 +81,8 @@ public class JobDeregisterResponse { @SerializedName(SERIALIZED_NAME_REQUEST_TIME) private Long requestTime; + public JobDeregisterResponse() { + } public JobDeregisterResponse evalCreateIndex(Integer evalCreateIndex) { @@ -252,6 +274,7 @@ public void setRequestTime(Long requestTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -303,5 +326,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobDeregisterResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobDeregisterResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobDeregisterResponse is not found in the empty JSON string", JobDeregisterResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobDeregisterResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobDeregisterResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobDeregisterResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobDeregisterResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobDeregisterResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobDeregisterResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobDeregisterResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobDeregisterResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobDeregisterResponse + * @throws IOException if the JSON string is invalid with respect to JobDeregisterResponse + */ + public static JobDeregisterResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobDeregisterResponse.class); + } + + /** + * Convert an instance of JobDeregisterResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDiff.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDiff.java index 86f8e56d..f20a9ad6 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDiff.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDiff.java @@ -29,6 +29,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobDiff */ @@ -54,6 +74,8 @@ public class JobDiff { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public JobDiff() { + } public JobDiff fields(List fields) { @@ -63,7 +85,7 @@ public JobDiff fields(List fields) { public JobDiff addFieldsItem(FieldDiff fieldsItem) { if (this.fields == null) { - this.fields = new ArrayList(); + this.fields = new ArrayList<>(); } this.fields.add(fieldsItem); return this; @@ -117,7 +139,7 @@ public JobDiff objects(List objects) { public JobDiff addObjectsItem(ObjectDiff objectsItem) { if (this.objects == null) { - this.objects = new ArrayList(); + this.objects = new ArrayList<>(); } this.objects.add(objectsItem); return this; @@ -148,7 +170,7 @@ public JobDiff taskGroups(List taskGroups) { public JobDiff addTaskGroupsItem(TaskGroupDiff taskGroupsItem) { if (this.taskGroups == null) { - this.taskGroups = new ArrayList(); + this.taskGroups = new ArrayList<>(); } this.taskGroups.add(taskGroupsItem); return this; @@ -194,6 +216,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -239,5 +262,136 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Fields"); + openapiFields.add("ID"); + openapiFields.add("Objects"); + openapiFields.add("TaskGroups"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobDiff + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobDiff.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobDiff is not found in the empty JSON string", JobDiff.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobDiff.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobDiff` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("Fields"); + if (jsonArrayfields != null) { + // ensure the json data is an array + if (!jsonObj.get("Fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Fields` to be an array in the JSON string but got `%s`", jsonObj.get("Fields").toString())); + } + + // validate the optional field `Fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + FieldDiff.validateJsonObject(jsonArrayfields.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + JsonArray jsonArrayobjects = jsonObj.getAsJsonArray("Objects"); + if (jsonArrayobjects != null) { + // ensure the json data is an array + if (!jsonObj.get("Objects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Objects` to be an array in the JSON string but got `%s`", jsonObj.get("Objects").toString())); + } + + // validate the optional field `Objects` (array) + for (int i = 0; i < jsonArrayobjects.size(); i++) { + ObjectDiff.validateJsonObject(jsonArrayobjects.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraytaskGroups = jsonObj.getAsJsonArray("TaskGroups"); + if (jsonArraytaskGroups != null) { + // ensure the json data is an array + if (!jsonObj.get("TaskGroups").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TaskGroups` to be an array in the JSON string but got `%s`", jsonObj.get("TaskGroups").toString())); + } + + // validate the optional field `TaskGroups` (array) + for (int i = 0; i < jsonArraytaskGroups.size(); i++) { + TaskGroupDiff.validateJsonObject(jsonArraytaskGroups.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobDiff.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobDiff' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobDiff.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobDiff value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobDiff read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobDiff given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobDiff + * @throws IOException if the JSON string is invalid with respect to JobDiff + */ + public static JobDiff fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobDiff.class); + } + + /** + * Convert an instance of JobDiff to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchRequest.java index b6ba6b0e..79b9b6ed 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchRequest.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobDispatchRequest */ @@ -44,6 +64,8 @@ public class JobDispatchRequest { @SerializedName(SERIALIZED_NAME_PAYLOAD) private byte[] payload; + public JobDispatchRequest() { + } public JobDispatchRequest jobID(String jobID) { @@ -76,7 +98,7 @@ public JobDispatchRequest meta(Map meta) { public JobDispatchRequest putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -122,6 +144,7 @@ public void setPayload(byte[] payload) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -163,5 +186,95 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JobID"); + openapiFields.add("Meta"); + openapiFields.add("Payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobDispatchRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobDispatchRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobDispatchRequest is not found in the empty JSON string", JobDispatchRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobDispatchRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobDispatchRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobDispatchRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobDispatchRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobDispatchRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobDispatchRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobDispatchRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobDispatchRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobDispatchRequest + * @throws IOException if the JSON string is invalid with respect to JobDispatchRequest + */ + public static JobDispatchRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobDispatchRequest.class); + } + + /** + * Convert an instance of JobDispatchRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchResponse.java index 4aabdb6a..6135c088 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobDispatchResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobDispatchResponse */ @@ -53,6 +73,8 @@ public class JobDispatchResponse { @SerializedName(SERIALIZED_NAME_REQUEST_TIME) private Long requestTime; + public JobDispatchResponse() { + } public JobDispatchResponse dispatchedJobID(String dispatchedJobID) { @@ -198,6 +220,7 @@ public void setRequestTime(Long requestTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -245,5 +268,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DispatchedJobID"); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalID"); + openapiFields.add("JobCreateIndex"); + openapiFields.add("LastIndex"); + openapiFields.add("RequestTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobDispatchResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobDispatchResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobDispatchResponse is not found in the empty JSON string", JobDispatchResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobDispatchResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobDispatchResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("DispatchedJobID") != null && !jsonObj.get("DispatchedJobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DispatchedJobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DispatchedJobID").toString())); + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobDispatchResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobDispatchResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobDispatchResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobDispatchResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobDispatchResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobDispatchResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobDispatchResponse + * @throws IOException if the JSON string is invalid with respect to JobDispatchResponse + */ + public static JobDispatchResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobDispatchResponse.class); + } + + /** + * Convert an instance of JobDispatchResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobEvaluateRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobEvaluateRequest.java index 8fd49459..eb393e59 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobEvaluateRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobEvaluateRequest.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobEvaluateRequest @@ -50,6 +71,8 @@ public class JobEvaluateRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public JobEvaluateRequest() { + } public JobEvaluateRequest evalOptions(EvalOptions evalOptions) { @@ -166,6 +189,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -182,11 +206,22 @@ public boolean equals(Object o) { Objects.equals(this.secretID, jobEvaluateRequest.secretID); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(evalOptions, jobID, namespace, region, secretID); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,5 +246,110 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalOptions"); + openapiFields.add("JobID"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobEvaluateRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobEvaluateRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobEvaluateRequest is not found in the empty JSON string", JobEvaluateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobEvaluateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobEvaluateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `EvalOptions` + if (jsonObj.getAsJsonObject("EvalOptions") != null) { + EvalOptions.validateJsonObject(jsonObj.getAsJsonObject("EvalOptions")); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobEvaluateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobEvaluateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobEvaluateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobEvaluateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobEvaluateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobEvaluateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobEvaluateRequest + * @throws IOException if the JSON string is invalid with respect to JobEvaluateRequest + */ + public static JobEvaluateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobEvaluateRequest.class); + } + + /** + * Convert an instance of JobEvaluateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobListStub.java index 9a785439..ce7a1ad2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobListStub.java @@ -26,6 +26,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobListStub @@ -100,6 +121,8 @@ public class JobListStub { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public JobListStub() { + } public JobListStub createIndex(Integer createIndex) { @@ -134,7 +157,7 @@ public JobListStub datacenters(List datacenters) { public JobListStub addDatacentersItem(String datacentersItem) { if (this.datacenters == null) { - this.datacenters = new ArrayList(); + this.datacenters = new ArrayList<>(); } this.datacenters.add(datacentersItem); return this; @@ -506,6 +529,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -534,11 +558,22 @@ public boolean equals(Object o) { Objects.equals(this.type, jobListStub.type); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(createIndex, datacenters, ID, jobModifyIndex, jobSummary, modifyIndex, name, namespace, parameterizedJob, parentID, periodic, priority, status, statusDescription, stop, submitTime, type); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -575,5 +610,135 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Datacenters"); + openapiFields.add("ID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("JobSummary"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("Namespace"); + openapiFields.add("ParameterizedJob"); + openapiFields.add("ParentID"); + openapiFields.add("Periodic"); + openapiFields.add("Priority"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("Stop"); + openapiFields.add("SubmitTime"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobListStub is not found in the empty JSON string", JobListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("Datacenters") != null && !jsonObj.get("Datacenters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenters` to be an array in the JSON string but got `%s`", jsonObj.get("Datacenters").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `JobSummary` + if (jsonObj.getAsJsonObject("JobSummary") != null) { + JobSummary.validateJsonObject(jsonObj.getAsJsonObject("JobSummary")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("ParentID") != null && !jsonObj.get("ParentID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ParentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ParentID").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobListStub + * @throws IOException if the JSON string is invalid with respect to JobListStub + */ + public static JobListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobListStub.class); + } + + /** + * Convert an instance of JobListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanRequest.java index b388e5aa..d5d6cb46 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanRequest.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobPlanRequest @@ -54,6 +75,8 @@ public class JobPlanRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public JobPlanRequest() { + } public JobPlanRequest diff(Boolean diff) { @@ -193,6 +216,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -210,11 +234,22 @@ public boolean equals(Object o) { Objects.equals(this.secretID, jobPlanRequest.secretID); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(diff, job, namespace, policyOverride, region, secretID); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -240,5 +275,108 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Diff"); + openapiFields.add("Job"); + openapiFields.add("Namespace"); + openapiFields.add("PolicyOverride"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobPlanRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobPlanRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobPlanRequest is not found in the empty JSON string", JobPlanRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobPlanRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobPlanRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Job` + if (jsonObj.getAsJsonObject("Job") != null) { + Job.validateJsonObject(jsonObj.getAsJsonObject("Job")); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobPlanRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobPlanRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobPlanRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobPlanRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobPlanRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobPlanRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobPlanRequest + * @throws IOException if the JSON string is invalid with respect to JobPlanRequest + */ + public static JobPlanRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobPlanRequest.class); + } + + /** + * Convert an instance of JobPlanRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanResponse.java index 6654e9ba..e1a8759f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobPlanResponse.java @@ -27,11 +27,32 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobPlanResponse @@ -66,6 +87,8 @@ public class JobPlanResponse { @SerializedName(SERIALIZED_NAME_WARNINGS) private String warnings; + public JobPlanResponse() { + } public JobPlanResponse annotations(PlanAnnotations annotations) { @@ -98,7 +121,7 @@ public JobPlanResponse createdEvals(List createdEvals) { public JobPlanResponse addCreatedEvalsItem(Evaluation createdEvalsItem) { if (this.createdEvals == null) { - this.createdEvals = new ArrayList(); + this.createdEvals = new ArrayList<>(); } this.createdEvals.add(createdEvalsItem); return this; @@ -152,7 +175,7 @@ public JobPlanResponse failedTGAllocs(Map failedTGAllo public JobPlanResponse putFailedTGAllocsItem(String key, AllocationMetric failedTGAllocsItem) { if (this.failedTGAllocs == null) { - this.failedTGAllocs = new HashMap(); + this.failedTGAllocs = new HashMap<>(); } this.failedTGAllocs.put(key, failedTGAllocsItem); return this; @@ -246,6 +269,7 @@ public void setWarnings(String warnings) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -264,11 +288,22 @@ public boolean equals(Object o) { Objects.equals(this.warnings, jobPlanResponse.warnings); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(annotations, createdEvals, diff, failedTGAllocs, jobModifyIndex, nextPeriodicLaunch, warnings); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -295,5 +330,119 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Annotations"); + openapiFields.add("CreatedEvals"); + openapiFields.add("Diff"); + openapiFields.add("FailedTGAllocs"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("NextPeriodicLaunch"); + openapiFields.add("Warnings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobPlanResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobPlanResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobPlanResponse is not found in the empty JSON string", JobPlanResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobPlanResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobPlanResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Annotations` + if (jsonObj.getAsJsonObject("Annotations") != null) { + PlanAnnotations.validateJsonObject(jsonObj.getAsJsonObject("Annotations")); + } + JsonArray jsonArraycreatedEvals = jsonObj.getAsJsonArray("CreatedEvals"); + if (jsonArraycreatedEvals != null) { + // ensure the json data is an array + if (!jsonObj.get("CreatedEvals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CreatedEvals` to be an array in the JSON string but got `%s`", jsonObj.get("CreatedEvals").toString())); + } + + // validate the optional field `CreatedEvals` (array) + for (int i = 0; i < jsonArraycreatedEvals.size(); i++) { + Evaluation.validateJsonObject(jsonArraycreatedEvals.get(i).getAsJsonObject()); + }; + } + // validate the optional field `Diff` + if (jsonObj.getAsJsonObject("Diff") != null) { + JobDiff.validateJsonObject(jsonObj.getAsJsonObject("Diff")); + } + if (jsonObj.get("Warnings") != null && !jsonObj.get("Warnings").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Warnings` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Warnings").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobPlanResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobPlanResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobPlanResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobPlanResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobPlanResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobPlanResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobPlanResponse + * @throws IOException if the JSON string is invalid with respect to JobPlanResponse + */ + public static JobPlanResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobPlanResponse.class); + } + + /** + * Convert an instance of JobPlanResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterRequest.java index f7dfb1d2..4d050c82 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterRequest.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobRegisterRequest @@ -66,6 +87,8 @@ public class JobRegisterRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public JobRegisterRequest() { + } public JobRegisterRequest enforceIndex(Boolean enforceIndex) { @@ -276,6 +299,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -296,11 +320,22 @@ public boolean equals(Object o) { Objects.equals(this.secretID, jobRegisterRequest.secretID); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(enforceIndex, evalPriority, job, jobModifyIndex, namespace, policyOverride, preserveCounts, region, secretID); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -329,5 +364,111 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EnforceIndex"); + openapiFields.add("EvalPriority"); + openapiFields.add("Job"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("Namespace"); + openapiFields.add("PolicyOverride"); + openapiFields.add("PreserveCounts"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobRegisterRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobRegisterRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobRegisterRequest is not found in the empty JSON string", JobRegisterRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobRegisterRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobRegisterRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Job` + if (jsonObj.getAsJsonObject("Job") != null) { + Job.validateJsonObject(jsonObj.getAsJsonObject("Job")); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobRegisterRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobRegisterRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobRegisterRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobRegisterRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobRegisterRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobRegisterRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobRegisterRequest + * @throws IOException if the JSON string is invalid with respect to JobRegisterRequest + */ + public static JobRegisterRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobRegisterRequest.class); + } + + /** + * Convert an instance of JobRegisterRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterResponse.java index bd7744ce..9cb17c68 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRegisterResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobRegisterResponse */ @@ -65,6 +85,8 @@ public class JobRegisterResponse { @SerializedName(SERIALIZED_NAME_WARNINGS) private String warnings; + public JobRegisterResponse() { + } public JobRegisterResponse evalCreateIndex(Integer evalCreateIndex) { @@ -279,6 +301,7 @@ public void setWarnings(String warnings) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -332,5 +355,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("Warnings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobRegisterResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobRegisterResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobRegisterResponse is not found in the empty JSON string", JobRegisterResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobRegisterResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobRegisterResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + if (jsonObj.get("Warnings") != null && !jsonObj.get("Warnings").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Warnings` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Warnings").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobRegisterResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobRegisterResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobRegisterResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobRegisterResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobRegisterResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobRegisterResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobRegisterResponse + * @throws IOException if the JSON string is invalid with respect to JobRegisterResponse + */ + public static JobRegisterResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobRegisterResponse.class); + } + + /** + * Convert an instance of JobRegisterResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRevertRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRevertRequest.java index 5a0358e4..061c14be 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRevertRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobRevertRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobRevertRequest */ @@ -61,6 +81,8 @@ public class JobRevertRequest { @SerializedName(SERIALIZED_NAME_VAULT_TOKEN) private String vaultToken; + public JobRevertRequest() { + } public JobRevertRequest consulToken(String consulToken) { @@ -250,6 +272,7 @@ public void setVaultToken(String vaultToken) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -301,5 +324,115 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ConsulToken"); + openapiFields.add("EnforcePriorVersion"); + openapiFields.add("JobID"); + openapiFields.add("JobVersion"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("VaultToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobRevertRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobRevertRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobRevertRequest is not found in the empty JSON string", JobRevertRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobRevertRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobRevertRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ConsulToken") != null && !jsonObj.get("ConsulToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsulToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsulToken").toString())); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + if (jsonObj.get("VaultToken") != null && !jsonObj.get("VaultToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VaultToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VaultToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobRevertRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobRevertRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobRevertRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobRevertRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobRevertRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobRevertRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobRevertRequest + * @throws IOException if the JSON string is invalid with respect to JobRevertRequest + */ + public static JobRevertRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobRevertRequest.class); + } + + /** + * Convert an instance of JobRevertRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobScaleStatusResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobScaleStatusResponse.java index f7c5e9c7..2121d54b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobScaleStatusResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobScaleStatusResponse.java @@ -28,6 +28,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobScaleStatusResponse */ @@ -57,6 +77,8 @@ public class JobScaleStatusResponse { @SerializedName(SERIALIZED_NAME_TASK_GROUPS) private Map taskGroups = null; + public JobScaleStatusResponse() { + } public JobScaleStatusResponse jobCreateIndex(Integer jobCreateIndex) { @@ -185,7 +207,7 @@ public JobScaleStatusResponse taskGroups(Map taskG public JobScaleStatusResponse putTaskGroupsItem(String key, TaskGroupScaleStatus taskGroupsItem) { if (this.taskGroups == null) { - this.taskGroups = new HashMap(); + this.taskGroups = new HashMap<>(); } this.taskGroups.put(key, taskGroupsItem); return this; @@ -208,6 +230,7 @@ public void setTaskGroups(Map taskGroups) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -255,5 +278,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JobCreateIndex"); + openapiFields.add("JobID"); + openapiFields.add("JobModifyIndex"); + openapiFields.add("JobStopped"); + openapiFields.add("Namespace"); + openapiFields.add("TaskGroups"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobScaleStatusResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobScaleStatusResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobScaleStatusResponse is not found in the empty JSON string", JobScaleStatusResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobScaleStatusResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobScaleStatusResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobScaleStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobScaleStatusResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobScaleStatusResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobScaleStatusResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobScaleStatusResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobScaleStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobScaleStatusResponse + * @throws IOException if the JSON string is invalid with respect to JobScaleStatusResponse + */ + public static JobScaleStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobScaleStatusResponse.class); + } + + /** + * Convert an instance of JobScaleStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityRequest.java index 4a444f73..d8b8e36e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobStabilityRequest */ @@ -53,6 +73,8 @@ public class JobStabilityRequest { @SerializedName(SERIALIZED_NAME_STABLE) private Boolean stable; + public JobStabilityRequest() { + } public JobStabilityRequest jobID(String jobID) { @@ -194,6 +216,7 @@ public void setStable(Boolean stable) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -241,5 +264,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JobID"); + openapiFields.add("JobVersion"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("Stable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobStabilityRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobStabilityRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobStabilityRequest is not found in the empty JSON string", JobStabilityRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobStabilityRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobStabilityRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobStabilityRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobStabilityRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobStabilityRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobStabilityRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobStabilityRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobStabilityRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobStabilityRequest + * @throws IOException if the JSON string is invalid with respect to JobStabilityRequest + */ + public static JobStabilityRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobStabilityRequest.class); + } + + /** + * Convert an instance of JobStabilityRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityResponse.java index b62d82f3..b558e21e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobStabilityResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobStabilityResponse */ @@ -33,6 +53,8 @@ public class JobStabilityResponse { @SerializedName(SERIALIZED_NAME_INDEX) private Integer index; + public JobStabilityResponse() { + } public JobStabilityResponse index(Integer index) { @@ -59,6 +81,7 @@ public void setIndex(Integer index) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -96,5 +119,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Index"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobStabilityResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobStabilityResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobStabilityResponse is not found in the empty JSON string", JobStabilityResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobStabilityResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobStabilityResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobStabilityResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobStabilityResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobStabilityResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobStabilityResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobStabilityResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobStabilityResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobStabilityResponse + * @throws IOException if the JSON string is invalid with respect to JobStabilityResponse + */ + public static JobStabilityResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobStabilityResponse.class); + } + + /** + * Convert an instance of JobStabilityResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobSummary.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobSummary.java index 0e44081e..d5cc9dd0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobSummary.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobSummary.java @@ -28,6 +28,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobSummary @@ -58,6 +79,8 @@ public class JobSummary { @SerializedName(SERIALIZED_NAME_SUMMARY) private Map summary = null; + public JobSummary() { + } public JobSummary children(JobChildrenSummary children) { @@ -186,7 +209,7 @@ public JobSummary summary(Map summary) { public JobSummary putSummaryItem(String key, TaskGroupSummary summaryItem) { if (this.summary == null) { - this.summary = new HashMap(); + this.summary = new HashMap<>(); } this.summary.put(key, summaryItem); return this; @@ -209,6 +232,7 @@ public void setSummary(Map summary) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -226,11 +250,22 @@ public boolean equals(Object o) { Objects.equals(this.summary, jobSummary.summary); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(children, createIndex, jobID, modifyIndex, namespace, summary); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,5 +291,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Children"); + openapiFields.add("CreateIndex"); + openapiFields.add("JobID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Namespace"); + openapiFields.add("Summary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobSummary.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobSummary is not found in the empty JSON string", JobSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobSummary` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Children` + if (jsonObj.getAsJsonObject("Children") != null) { + JobChildrenSummary.validateJsonObject(jsonObj.getAsJsonObject("Children")); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobSummary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobSummary value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobSummary + * @throws IOException if the JSON string is invalid with respect to JobSummary + */ + public static JobSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobSummary.class); + } + + /** + * Convert an instance of JobSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateRequest.java index 8d29d333..a30748d6 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateRequest.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * JobValidateRequest @@ -46,6 +67,8 @@ public class JobValidateRequest { @SerializedName(SERIALIZED_NAME_SECRET_I_D) private String secretID; + public JobValidateRequest() { + } public JobValidateRequest job(Job job) { @@ -139,6 +162,7 @@ public void setSecretID(String secretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -154,11 +178,22 @@ public boolean equals(Object o) { Objects.equals(this.secretID, jobValidateRequest.secretID); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(job, namespace, region, secretID); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -182,5 +217,106 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Job"); + openapiFields.add("Namespace"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobValidateRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobValidateRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobValidateRequest is not found in the empty JSON string", JobValidateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobValidateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobValidateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Job` + if (jsonObj.getAsJsonObject("Job") != null) { + Job.validateJsonObject(jsonObj.getAsJsonObject("Job")); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobValidateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobValidateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobValidateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobValidateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobValidateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobValidateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobValidateRequest + * @throws IOException if the JSON string is invalid with respect to JobValidateRequest + */ + public static JobValidateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobValidateRequest.class); + } + + /** + * Convert an instance of JobValidateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateResponse.java index e7ded70e..9eec890f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobValidateResponse.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobValidateResponse */ @@ -47,6 +67,8 @@ public class JobValidateResponse { @SerializedName(SERIALIZED_NAME_WARNINGS) private String warnings; + public JobValidateResponse() { + } public JobValidateResponse driverConfigValidated(Boolean driverConfigValidated) { @@ -102,7 +124,7 @@ public JobValidateResponse validationErrors(List validationErrors) { public JobValidateResponse addValidationErrorsItem(String validationErrorsItem) { if (this.validationErrors == null) { - this.validationErrors = new ArrayList(); + this.validationErrors = new ArrayList<>(); } this.validationErrors.add(validationErrorsItem); return this; @@ -148,6 +170,7 @@ public void setWarnings(String warnings) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -191,5 +214,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DriverConfigValidated"); + openapiFields.add("Error"); + openapiFields.add("ValidationErrors"); + openapiFields.add("Warnings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobValidateResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobValidateResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobValidateResponse is not found in the empty JSON string", JobValidateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobValidateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobValidateResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Error") != null && !jsonObj.get("Error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Error").toString())); + } + // ensure the json data is an array + if (jsonObj.get("ValidationErrors") != null && !jsonObj.get("ValidationErrors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ValidationErrors` to be an array in the JSON string but got `%s`", jsonObj.get("ValidationErrors").toString())); + } + if (jsonObj.get("Warnings") != null && !jsonObj.get("Warnings").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Warnings` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Warnings").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobValidateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobValidateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobValidateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobValidateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobValidateResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobValidateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobValidateResponse + * @throws IOException if the JSON string is invalid with respect to JobValidateResponse + */ + public static JobValidateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobValidateResponse.class); + } + + /** + * Convert an instance of JobValidateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobVersionsResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobVersionsResponse.java index 93e50e5d..f8ee29fa 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobVersionsResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobVersionsResponse.java @@ -28,6 +28,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobVersionsResponse */ @@ -61,6 +81,8 @@ public class JobVersionsResponse { @SerializedName(SERIALIZED_NAME_VERSIONS) private List versions = null; + public JobVersionsResponse() { + } public JobVersionsResponse diffs(List diffs) { @@ -70,7 +92,7 @@ public JobVersionsResponse diffs(List diffs) { public JobVersionsResponse addDiffsItem(JobDiff diffsItem) { if (this.diffs == null) { - this.diffs = new ArrayList(); + this.diffs = new ArrayList<>(); } this.diffs.add(diffsItem); return this; @@ -218,7 +240,7 @@ public JobVersionsResponse versions(List versions) { public JobVersionsResponse addVersionsItem(Job versionsItem) { if (this.versions == null) { - this.versions = new ArrayList(); + this.versions = new ArrayList<>(); } this.versions.add(versionsItem); return this; @@ -241,6 +263,7 @@ public void setVersions(List versions) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -290,5 +313,123 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Diffs"); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("Versions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobVersionsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobVersionsResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobVersionsResponse is not found in the empty JSON string", JobVersionsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobVersionsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobVersionsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraydiffs = jsonObj.getAsJsonArray("Diffs"); + if (jsonArraydiffs != null) { + // ensure the json data is an array + if (!jsonObj.get("Diffs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Diffs` to be an array in the JSON string but got `%s`", jsonObj.get("Diffs").toString())); + } + + // validate the optional field `Diffs` (array) + for (int i = 0; i < jsonArraydiffs.size(); i++) { + JobDiff.validateJsonObject(jsonArraydiffs.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + JsonArray jsonArrayversions = jsonObj.getAsJsonArray("Versions"); + if (jsonArrayversions != null) { + // ensure the json data is an array + if (!jsonObj.get("Versions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Versions` to be an array in the JSON string but got `%s`", jsonObj.get("Versions").toString())); + } + + // validate the optional field `Versions` (array) + for (int i = 0; i < jsonArrayversions.size(); i++) { + Job.validateJsonObject(jsonArrayversions.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobVersionsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobVersionsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobVersionsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobVersionsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobVersionsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobVersionsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobVersionsResponse + * @throws IOException if the JSON string is invalid with respect to JobVersionsResponse + */ + public static JobVersionsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobVersionsResponse.class); + } + + /** + * Convert an instance of JobVersionsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobsParseRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobsParseRequest.java index fec7dfd6..ff05c36a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/JobsParseRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/JobsParseRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * JobsParseRequest */ @@ -41,6 +61,8 @@ public class JobsParseRequest { @SerializedName(SERIALIZED_NAME_HCLV1) private Boolean hclv1; + public JobsParseRequest() { + } public JobsParseRequest canonicalize(Boolean canonicalize) { @@ -111,6 +133,7 @@ public void setHclv1(Boolean hclv1) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,95 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Canonicalize"); + openapiFields.add("JobHCL"); + openapiFields.add("hclv1"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JobsParseRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JobsParseRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JobsParseRequest is not found in the empty JSON string", JobsParseRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JobsParseRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobsParseRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("JobHCL") != null && !jsonObj.get("JobHCL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobHCL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobHCL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobsParseRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobsParseRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobsParseRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobsParseRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobsParseRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobsParseRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobsParseRequest + * @throws IOException if the JSON string is invalid with respect to JobsParseRequest + */ + public static JobsParseRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobsParseRequest.class); + } + + /** + * Convert an instance of JobsParseRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/LogConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/LogConfig.java index 13e58af2..00c9d446 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/LogConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/LogConfig.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * LogConfig */ @@ -37,6 +57,8 @@ public class LogConfig { @SerializedName(SERIALIZED_NAME_MAX_FILES) private Integer maxFiles; + public LogConfig() { + } public LogConfig maxFileSizeMB(Integer maxFileSizeMB) { @@ -84,6 +106,7 @@ public void setMaxFiles(Integer maxFiles) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("MaxFileSizeMB"); + openapiFields.add("MaxFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to LogConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (LogConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in LogConfig is not found in the empty JSON string", LogConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!LogConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LogConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LogConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LogConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LogConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LogConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LogConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LogConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of LogConfig + * @throws IOException if the JSON string is invalid with respect to LogConfig + */ + public static LogConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LogConfig.class); + } + + /** + * Convert an instance of LogConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/MetricsSummary.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/MetricsSummary.java index 72436bc3..180a8182 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/MetricsSummary.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/MetricsSummary.java @@ -29,6 +29,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * MetricsSummary */ @@ -54,6 +74,8 @@ public class MetricsSummary { @SerializedName(SERIALIZED_NAME_TIMESTAMP) private String timestamp; + public MetricsSummary() { + } public MetricsSummary counters(List counters) { @@ -63,7 +85,7 @@ public MetricsSummary counters(List counters) { public MetricsSummary addCountersItem(SampledValue countersItem) { if (this.counters == null) { - this.counters = new ArrayList(); + this.counters = new ArrayList<>(); } this.counters.add(countersItem); return this; @@ -94,7 +116,7 @@ public MetricsSummary gauges(List gauges) { public MetricsSummary addGaugesItem(GaugeValue gaugesItem) { if (this.gauges == null) { - this.gauges = new ArrayList(); + this.gauges = new ArrayList<>(); } this.gauges.add(gaugesItem); return this; @@ -125,7 +147,7 @@ public MetricsSummary points(List points) { public MetricsSummary addPointsItem(PointValue pointsItem) { if (this.points == null) { - this.points = new ArrayList(); + this.points = new ArrayList<>(); } this.points.add(pointsItem); return this; @@ -156,7 +178,7 @@ public MetricsSummary samples(List samples) { public MetricsSummary addSamplesItem(SampledValue samplesItem) { if (this.samples == null) { - this.samples = new ArrayList(); + this.samples = new ArrayList<>(); } this.samples.add(samplesItem); return this; @@ -202,6 +224,7 @@ public void setTimestamp(String timestamp) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -247,5 +270,145 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Counters"); + openapiFields.add("Gauges"); + openapiFields.add("Points"); + openapiFields.add("Samples"); + openapiFields.add("Timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MetricsSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MetricsSummary.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MetricsSummary is not found in the empty JSON string", MetricsSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MetricsSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MetricsSummary` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraycounters = jsonObj.getAsJsonArray("Counters"); + if (jsonArraycounters != null) { + // ensure the json data is an array + if (!jsonObj.get("Counters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Counters` to be an array in the JSON string but got `%s`", jsonObj.get("Counters").toString())); + } + + // validate the optional field `Counters` (array) + for (int i = 0; i < jsonArraycounters.size(); i++) { + SampledValue.validateJsonObject(jsonArraycounters.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraygauges = jsonObj.getAsJsonArray("Gauges"); + if (jsonArraygauges != null) { + // ensure the json data is an array + if (!jsonObj.get("Gauges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Gauges` to be an array in the JSON string but got `%s`", jsonObj.get("Gauges").toString())); + } + + // validate the optional field `Gauges` (array) + for (int i = 0; i < jsonArraygauges.size(); i++) { + GaugeValue.validateJsonObject(jsonArraygauges.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraypoints = jsonObj.getAsJsonArray("Points"); + if (jsonArraypoints != null) { + // ensure the json data is an array + if (!jsonObj.get("Points").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Points` to be an array in the JSON string but got `%s`", jsonObj.get("Points").toString())); + } + + // validate the optional field `Points` (array) + for (int i = 0; i < jsonArraypoints.size(); i++) { + PointValue.validateJsonObject(jsonArraypoints.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraysamples = jsonObj.getAsJsonArray("Samples"); + if (jsonArraysamples != null) { + // ensure the json data is an array + if (!jsonObj.get("Samples").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Samples` to be an array in the JSON string but got `%s`", jsonObj.get("Samples").toString())); + } + + // validate the optional field `Samples` (array) + for (int i = 0; i < jsonArraysamples.size(); i++) { + SampledValue.validateJsonObject(jsonArraysamples.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Timestamp") != null && !jsonObj.get("Timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Timestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MetricsSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MetricsSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MetricsSummary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MetricsSummary value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MetricsSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MetricsSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetricsSummary + * @throws IOException if the JSON string is invalid with respect to MetricsSummary + */ + public static MetricsSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MetricsSummary.class); + } + + /** + * Convert an instance of MetricsSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/MigrateStrategy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/MigrateStrategy.java index f3c0d9e4..66466ed2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/MigrateStrategy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/MigrateStrategy.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * MigrateStrategy */ @@ -45,6 +65,8 @@ public class MigrateStrategy { @SerializedName(SERIALIZED_NAME_MIN_HEALTHY_TIME) private Long minHealthyTime; + public MigrateStrategy() { + } public MigrateStrategy healthCheck(String healthCheck) { @@ -138,6 +160,7 @@ public void setMinHealthyTime(Long minHealthyTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("HealthCheck"); + openapiFields.add("HealthyDeadline"); + openapiFields.add("MaxParallel"); + openapiFields.add("MinHealthyTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MigrateStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MigrateStrategy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MigrateStrategy is not found in the empty JSON string", MigrateStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MigrateStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MigrateStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("HealthCheck") != null && !jsonObj.get("HealthCheck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HealthCheck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HealthCheck").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MigrateStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MigrateStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MigrateStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MigrateStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MigrateStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MigrateStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of MigrateStrategy + * @throws IOException if the JSON string is invalid with respect to MigrateStrategy + */ + public static MigrateStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MigrateStrategy.class); + } + + /** + * Convert an instance of MigrateStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Multiregion.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Multiregion.java index 39d36611..05f692d9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Multiregion.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Multiregion.java @@ -28,6 +28,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Multiregion */ @@ -41,6 +61,8 @@ public class Multiregion { @SerializedName(SERIALIZED_NAME_STRATEGY) private MultiregionStrategy strategy; + public Multiregion() { + } public Multiregion regions(List regions) { @@ -50,7 +72,7 @@ public Multiregion regions(List regions) { public Multiregion addRegionsItem(MultiregionRegion regionsItem) { if (this.regions == null) { - this.regions = new ArrayList(); + this.regions = new ArrayList<>(); } this.regions.add(regionsItem); return this; @@ -96,6 +118,7 @@ public void setStrategy(MultiregionStrategy strategy) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -135,5 +158,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Regions"); + openapiFields.add("Strategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Multiregion + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Multiregion.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Multiregion is not found in the empty JSON string", Multiregion.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Multiregion.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Multiregion` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayregions = jsonObj.getAsJsonArray("Regions"); + if (jsonArrayregions != null) { + // ensure the json data is an array + if (!jsonObj.get("Regions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Regions` to be an array in the JSON string but got `%s`", jsonObj.get("Regions").toString())); + } + + // validate the optional field `Regions` (array) + for (int i = 0; i < jsonArrayregions.size(); i++) { + MultiregionRegion.validateJsonObject(jsonArrayregions.get(i).getAsJsonObject()); + }; + } + // validate the optional field `Strategy` + if (jsonObj.getAsJsonObject("Strategy") != null) { + MultiregionStrategy.validateJsonObject(jsonObj.getAsJsonObject("Strategy")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Multiregion.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Multiregion' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Multiregion.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Multiregion value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Multiregion read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Multiregion given an JSON string + * + * @param jsonString JSON string + * @return An instance of Multiregion + * @throws IOException if the JSON string is invalid with respect to Multiregion + */ + public static Multiregion fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Multiregion.class); + } + + /** + * Convert an instance of Multiregion to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionRegion.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionRegion.java index 3d43a1a3..70966f7f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionRegion.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionRegion.java @@ -28,6 +28,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * MultiregionRegion */ @@ -49,6 +69,8 @@ public class MultiregionRegion { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public MultiregionRegion() { + } public MultiregionRegion count(Integer count) { @@ -81,7 +103,7 @@ public MultiregionRegion datacenters(List datacenters) { public MultiregionRegion addDatacentersItem(String datacentersItem) { if (this.datacenters == null) { - this.datacenters = new ArrayList(); + this.datacenters = new ArrayList<>(); } this.datacenters.add(datacentersItem); return this; @@ -112,7 +134,7 @@ public MultiregionRegion meta(Map meta) { public MultiregionRegion putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -158,6 +180,7 @@ public void setName(String name) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -201,5 +224,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Count"); + openapiFields.add("Datacenters"); + openapiFields.add("Meta"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MultiregionRegion + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MultiregionRegion.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MultiregionRegion is not found in the empty JSON string", MultiregionRegion.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MultiregionRegion.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MultiregionRegion` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("Datacenters") != null && !jsonObj.get("Datacenters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenters` to be an array in the JSON string but got `%s`", jsonObj.get("Datacenters").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MultiregionRegion.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MultiregionRegion' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MultiregionRegion.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MultiregionRegion value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MultiregionRegion read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MultiregionRegion given an JSON string + * + * @param jsonString JSON string + * @return An instance of MultiregionRegion + * @throws IOException if the JSON string is invalid with respect to MultiregionRegion + */ + public static MultiregionRegion fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MultiregionRegion.class); + } + + /** + * Convert an instance of MultiregionRegion to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionStrategy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionStrategy.java index 59dc5560..76ccd5f5 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionStrategy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/MultiregionStrategy.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * MultiregionStrategy */ @@ -37,6 +57,8 @@ public class MultiregionStrategy { @SerializedName(SERIALIZED_NAME_ON_FAILURE) private String onFailure; + public MultiregionStrategy() { + } public MultiregionStrategy maxParallel(Integer maxParallel) { @@ -84,6 +106,7 @@ public void setOnFailure(String onFailure) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("MaxParallel"); + openapiFields.add("OnFailure"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MultiregionStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MultiregionStrategy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MultiregionStrategy is not found in the empty JSON string", MultiregionStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MultiregionStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MultiregionStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("OnFailure") != null && !jsonObj.get("OnFailure").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OnFailure` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OnFailure").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MultiregionStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MultiregionStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MultiregionStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MultiregionStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MultiregionStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MultiregionStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of MultiregionStrategy + * @throws IOException if the JSON string is invalid with respect to MultiregionStrategy + */ + public static MultiregionStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MultiregionStrategy.class); + } + + /** + * Convert an instance of MultiregionStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Namespace.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Namespace.java index 36726f90..94c00ecd 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Namespace.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Namespace.java @@ -27,6 +27,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Namespace @@ -61,6 +82,8 @@ public class Namespace { @SerializedName(SERIALIZED_NAME_QUOTA) private String quota; + public Namespace() { + } public Namespace capabilities(NamespaceCapabilities capabilities) { @@ -141,7 +164,7 @@ public Namespace meta(Map meta) { public Namespace putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -235,6 +258,7 @@ public void setQuota(String quota) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -253,11 +277,22 @@ public boolean equals(Object o) { Objects.equals(this.quota, namespace.quota); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(capabilities, createIndex, description, meta, modifyIndex, name, quota); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -284,5 +319,109 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Capabilities"); + openapiFields.add("CreateIndex"); + openapiFields.add("Description"); + openapiFields.add("Meta"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("Quota"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Namespace + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Namespace.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Namespace is not found in the empty JSON string", Namespace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Namespace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Namespace` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Capabilities` + if (jsonObj.getAsJsonObject("Capabilities") != null) { + NamespaceCapabilities.validateJsonObject(jsonObj.getAsJsonObject("Capabilities")); + } + if (jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Namespace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Namespace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Namespace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Namespace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Namespace read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Namespace given an JSON string + * + * @param jsonString JSON string + * @return An instance of Namespace + * @throws IOException if the JSON string is invalid with respect to Namespace + */ + public static Namespace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Namespace.class); + } + + /** + * Convert an instance of Namespace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NamespaceCapabilities.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NamespaceCapabilities.java index 5ffacb73..52cc7bd1 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NamespaceCapabilities.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NamespaceCapabilities.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NamespaceCapabilities */ @@ -39,6 +59,8 @@ public class NamespaceCapabilities { @SerializedName(SERIALIZED_NAME_ENABLED_TASK_DRIVERS) private List enabledTaskDrivers = null; + public NamespaceCapabilities() { + } public NamespaceCapabilities disabledTaskDrivers(List disabledTaskDrivers) { @@ -48,7 +70,7 @@ public NamespaceCapabilities disabledTaskDrivers(List disabledTaskDriver public NamespaceCapabilities addDisabledTaskDriversItem(String disabledTaskDriversItem) { if (this.disabledTaskDrivers == null) { - this.disabledTaskDrivers = new ArrayList(); + this.disabledTaskDrivers = new ArrayList<>(); } this.disabledTaskDrivers.add(disabledTaskDriversItem); return this; @@ -79,7 +101,7 @@ public NamespaceCapabilities enabledTaskDrivers(List enabledTaskDrivers) public NamespaceCapabilities addEnabledTaskDriversItem(String enabledTaskDriversItem) { if (this.enabledTaskDrivers == null) { - this.enabledTaskDrivers = new ArrayList(); + this.enabledTaskDrivers = new ArrayList<>(); } this.enabledTaskDrivers.add(enabledTaskDriversItem); return this; @@ -102,6 +124,7 @@ public void setEnabledTaskDrivers(List enabledTaskDrivers) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -141,5 +164,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DisabledTaskDrivers"); + openapiFields.add("EnabledTaskDrivers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NamespaceCapabilities + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NamespaceCapabilities.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NamespaceCapabilities is not found in the empty JSON string", NamespaceCapabilities.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NamespaceCapabilities.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NamespaceCapabilities` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("DisabledTaskDrivers") != null && !jsonObj.get("DisabledTaskDrivers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `DisabledTaskDrivers` to be an array in the JSON string but got `%s`", jsonObj.get("DisabledTaskDrivers").toString())); + } + // ensure the json data is an array + if (jsonObj.get("EnabledTaskDrivers") != null && !jsonObj.get("EnabledTaskDrivers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `EnabledTaskDrivers` to be an array in the JSON string but got `%s`", jsonObj.get("EnabledTaskDrivers").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NamespaceCapabilities.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NamespaceCapabilities' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NamespaceCapabilities.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NamespaceCapabilities value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NamespaceCapabilities read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NamespaceCapabilities given an JSON string + * + * @param jsonString JSON string + * @return An instance of NamespaceCapabilities + * @throws IOException if the JSON string is invalid with respect to NamespaceCapabilities + */ + public static NamespaceCapabilities fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NamespaceCapabilities.class); + } + + /** + * Convert an instance of NamespaceCapabilities to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NetworkResource.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NetworkResource.java index d264692f..efb7b348 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NetworkResource.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NetworkResource.java @@ -27,6 +27,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NetworkResource @@ -69,6 +90,8 @@ public class NetworkResource { @SerializedName(SERIALIZED_NAME_RESERVED_PORTS) private List reservedPorts = null; + public NetworkResource() { + } public NetworkResource CIDR(String CIDR) { @@ -147,7 +170,7 @@ public NetworkResource dynamicPorts(List dynamicPorts) { public NetworkResource addDynamicPortsItem(Port dynamicPortsItem) { if (this.dynamicPorts == null) { - this.dynamicPorts = new ArrayList(); + this.dynamicPorts = new ArrayList<>(); } this.dynamicPorts.add(dynamicPortsItem); return this; @@ -270,7 +293,7 @@ public NetworkResource reservedPorts(List reservedPorts) { public NetworkResource addReservedPortsItem(Port reservedPortsItem) { if (this.reservedPorts == null) { - this.reservedPorts = new ArrayList(); + this.reservedPorts = new ArrayList<>(); } this.reservedPorts.add(reservedPortsItem); return this; @@ -293,6 +316,7 @@ public void setReservedPorts(List reservedPorts) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -313,11 +337,22 @@ public boolean equals(Object o) { Objects.equals(this.reservedPorts, networkResource.reservedPorts); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(CIDR, DNS, device, dynamicPorts, hostname, IP, mbits, mode, reservedPorts); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -346,5 +381,141 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CIDR"); + openapiFields.add("DNS"); + openapiFields.add("Device"); + openapiFields.add("DynamicPorts"); + openapiFields.add("Hostname"); + openapiFields.add("IP"); + openapiFields.add("MBits"); + openapiFields.add("Mode"); + openapiFields.add("ReservedPorts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NetworkResource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NetworkResource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NetworkResource is not found in the empty JSON string", NetworkResource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NetworkResource.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NetworkResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("CIDR") != null && !jsonObj.get("CIDR").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CIDR` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CIDR").toString())); + } + // validate the optional field `DNS` + if (jsonObj.getAsJsonObject("DNS") != null) { + DNSConfig.validateJsonObject(jsonObj.getAsJsonObject("DNS")); + } + if (jsonObj.get("Device") != null && !jsonObj.get("Device").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Device` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Device").toString())); + } + JsonArray jsonArraydynamicPorts = jsonObj.getAsJsonArray("DynamicPorts"); + if (jsonArraydynamicPorts != null) { + // ensure the json data is an array + if (!jsonObj.get("DynamicPorts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `DynamicPorts` to be an array in the JSON string but got `%s`", jsonObj.get("DynamicPorts").toString())); + } + + // validate the optional field `DynamicPorts` (array) + for (int i = 0; i < jsonArraydynamicPorts.size(); i++) { + Port.validateJsonObject(jsonArraydynamicPorts.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Hostname") != null && !jsonObj.get("Hostname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Hostname").toString())); + } + if (jsonObj.get("IP") != null && !jsonObj.get("IP").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IP").toString())); + } + if (jsonObj.get("Mode") != null && !jsonObj.get("Mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Mode").toString())); + } + JsonArray jsonArrayreservedPorts = jsonObj.getAsJsonArray("ReservedPorts"); + if (jsonArrayreservedPorts != null) { + // ensure the json data is an array + if (!jsonObj.get("ReservedPorts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ReservedPorts` to be an array in the JSON string but got `%s`", jsonObj.get("ReservedPorts").toString())); + } + + // validate the optional field `ReservedPorts` (array) + for (int i = 0; i < jsonArrayreservedPorts.size(); i++) { + Port.validateJsonObject(jsonArrayreservedPorts.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkResource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkResource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NetworkResource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkResource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkResource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkResource given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkResource + * @throws IOException if the JSON string is invalid with respect to NetworkResource + */ + public static NetworkResource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkResource.class); + } + + /** + * Convert an instance of NetworkResource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Node.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Node.java index 1d306930..8c1121cf 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Node.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Node.java @@ -37,6 +37,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Node @@ -159,6 +180,8 @@ public class Node { @SerializedName(SERIALIZED_NAME_TL_S_ENABLED) private Boolean tlSEnabled; + public Node() { + } public Node attributes(Map attributes) { @@ -168,7 +191,7 @@ public Node attributes(Map attributes) { public Node putAttributesItem(String key, String attributesItem) { if (this.attributes == null) { - this.attributes = new HashMap(); + this.attributes = new HashMap<>(); } this.attributes.put(key, attributesItem); return this; @@ -199,7 +222,7 @@ public Node csIControllerPlugins(Map csIControllerPlugins) { public Node putCsIControllerPluginsItem(String key, CSIInfo csIControllerPluginsItem) { if (this.csIControllerPlugins == null) { - this.csIControllerPlugins = new HashMap(); + this.csIControllerPlugins = new HashMap<>(); } this.csIControllerPlugins.put(key, csIControllerPluginsItem); return this; @@ -230,7 +253,7 @@ public Node csINodePlugins(Map csINodePlugins) { public Node putCsINodePluginsItem(String key, CSIInfo csINodePluginsItem) { if (this.csINodePlugins == null) { - this.csINodePlugins = new HashMap(); + this.csINodePlugins = new HashMap<>(); } this.csINodePlugins.put(key, csINodePluginsItem); return this; @@ -378,7 +401,7 @@ public Node drivers(Map drivers) { public Node putDriversItem(String key, DriverInfo driversItem) { if (this.drivers == null) { - this.drivers = new HashMap(); + this.drivers = new HashMap<>(); } this.drivers.put(key, driversItem); return this; @@ -409,7 +432,7 @@ public Node events(List events) { public Node addEventsItem(NodeEvent eventsItem) { if (this.events == null) { - this.events = new ArrayList(); + this.events = new ArrayList<>(); } this.events.add(eventsItem); return this; @@ -463,7 +486,7 @@ public Node hostNetworks(Map hostNetworks) { public Node putHostNetworksItem(String key, HostNetworkInfo hostNetworksItem) { if (this.hostNetworks == null) { - this.hostNetworks = new HashMap(); + this.hostNetworks = new HashMap<>(); } this.hostNetworks.put(key, hostNetworksItem); return this; @@ -494,7 +517,7 @@ public Node hostVolumes(Map hostVolumes) { public Node putHostVolumesItem(String key, HostVolumeInfo hostVolumesItem) { if (this.hostVolumes == null) { - this.hostVolumes = new HashMap(); + this.hostVolumes = new HashMap<>(); } this.hostVolumes.put(key, hostVolumesItem); return this; @@ -571,7 +594,7 @@ public Node links(Map links) { public Node putLinksItem(String key, String linksItem) { if (this.links == null) { - this.links = new HashMap(); + this.links = new HashMap<>(); } this.links.put(key, linksItem); return this; @@ -602,7 +625,7 @@ public Node meta(Map meta) { public Node putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -903,6 +926,7 @@ public void setTlSEnabled(Boolean tlSEnabled) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -943,11 +967,22 @@ public boolean equals(Object o) { Objects.equals(this.tlSEnabled, node.tlSEnabled); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(attributes, csIControllerPlugins, csINodePlugins, cgroupParent, createIndex, datacenter, drain, drainStrategy, drivers, events, htTPAddr, hostNetworks, hostVolumes, ID, lastDrain, links, meta, modifyIndex, name, nodeClass, nodeResources, reserved, reservedResources, resources, schedulingEligibility, status, statusDescription, statusUpdatedAt, tlSEnabled); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -996,5 +1031,181 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Attributes"); + openapiFields.add("CSIControllerPlugins"); + openapiFields.add("CSINodePlugins"); + openapiFields.add("CgroupParent"); + openapiFields.add("CreateIndex"); + openapiFields.add("Datacenter"); + openapiFields.add("Drain"); + openapiFields.add("DrainStrategy"); + openapiFields.add("Drivers"); + openapiFields.add("Events"); + openapiFields.add("HTTPAddr"); + openapiFields.add("HostNetworks"); + openapiFields.add("HostVolumes"); + openapiFields.add("ID"); + openapiFields.add("LastDrain"); + openapiFields.add("Links"); + openapiFields.add("Meta"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("NodeClass"); + openapiFields.add("NodeResources"); + openapiFields.add("Reserved"); + openapiFields.add("ReservedResources"); + openapiFields.add("Resources"); + openapiFields.add("SchedulingEligibility"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("StatusUpdatedAt"); + openapiFields.add("TLSEnabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Node + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Node.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Node is not found in the empty JSON string", Node.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Node.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Node` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("CgroupParent") != null && !jsonObj.get("CgroupParent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CgroupParent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CgroupParent").toString())); + } + if (jsonObj.get("Datacenter") != null && !jsonObj.get("Datacenter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Datacenter").toString())); + } + // validate the optional field `DrainStrategy` + if (jsonObj.getAsJsonObject("DrainStrategy") != null) { + DrainStrategy.validateJsonObject(jsonObj.getAsJsonObject("DrainStrategy")); + } + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("Events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("Events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Events` to be an array in the JSON string but got `%s`", jsonObj.get("Events").toString())); + } + + // validate the optional field `Events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + NodeEvent.validateJsonObject(jsonArrayevents.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("HTTPAddr") != null && !jsonObj.get("HTTPAddr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HTTPAddr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HTTPAddr").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `LastDrain` + if (jsonObj.getAsJsonObject("LastDrain") != null) { + DrainMetadata.validateJsonObject(jsonObj.getAsJsonObject("LastDrain")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("NodeClass") != null && !jsonObj.get("NodeClass").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeClass` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeClass").toString())); + } + // validate the optional field `NodeResources` + if (jsonObj.getAsJsonObject("NodeResources") != null) { + NodeResources.validateJsonObject(jsonObj.getAsJsonObject("NodeResources")); + } + // validate the optional field `Reserved` + if (jsonObj.getAsJsonObject("Reserved") != null) { + Resources.validateJsonObject(jsonObj.getAsJsonObject("Reserved")); + } + // validate the optional field `ReservedResources` + if (jsonObj.getAsJsonObject("ReservedResources") != null) { + NodeReservedResources.validateJsonObject(jsonObj.getAsJsonObject("ReservedResources")); + } + // validate the optional field `Resources` + if (jsonObj.getAsJsonObject("Resources") != null) { + Resources.validateJsonObject(jsonObj.getAsJsonObject("Resources")); + } + if (jsonObj.get("SchedulingEligibility") != null && !jsonObj.get("SchedulingEligibility").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SchedulingEligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SchedulingEligibility").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Node.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Node' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Node.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Node value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Node read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Node given an JSON string + * + * @param jsonString JSON string + * @return An instance of Node + * @throws IOException if the JSON string is invalid with respect to Node + */ + public static Node fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Node.class); + } + + /** + * Convert an instance of Node to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeCpuResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeCpuResources.java index a53d519f..7e9214b4 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeCpuResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeCpuResources.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeCpuResources */ @@ -43,6 +63,8 @@ public class NodeCpuResources { @SerializedName(SERIALIZED_NAME_TOTAL_CPU_CORES) private Integer totalCpuCores; + public NodeCpuResources() { + } public NodeCpuResources cpuShares(Long cpuShares) { @@ -75,7 +97,7 @@ public NodeCpuResources reservableCpuCores(List reservableCpuCores) { public NodeCpuResources addReservableCpuCoresItem(Integer reservableCpuCoresItem) { if (this.reservableCpuCores == null) { - this.reservableCpuCores = new ArrayList(); + this.reservableCpuCores = new ArrayList<>(); } this.reservableCpuCores.add(reservableCpuCoresItem); return this; @@ -123,6 +145,7 @@ public void setTotalCpuCores(Integer totalCpuCores) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -164,5 +187,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CpuShares"); + openapiFields.add("ReservableCpuCores"); + openapiFields.add("TotalCpuCores"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeCpuResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeCpuResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeCpuResources is not found in the empty JSON string", NodeCpuResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeCpuResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeCpuResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("ReservableCpuCores") != null && !jsonObj.get("ReservableCpuCores").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ReservableCpuCores` to be an array in the JSON string but got `%s`", jsonObj.get("ReservableCpuCores").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeCpuResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeCpuResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeCpuResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeCpuResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeCpuResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeCpuResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeCpuResources + * @throws IOException if the JSON string is invalid with respect to NodeCpuResources + */ + public static NodeCpuResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeCpuResources.class); + } + + /** + * Convert an instance of NodeCpuResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDevice.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDevice.java index 75823de5..2d4b5e54 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDevice.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDevice.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NodeDevice @@ -46,6 +67,8 @@ public class NodeDevice { @SerializedName(SERIALIZED_NAME_LOCALITY) private NodeDeviceLocality locality; + public NodeDevice() { + } public NodeDevice healthDescription(String healthDescription) { @@ -139,6 +162,7 @@ public void setLocality(NodeDeviceLocality locality) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -154,11 +178,22 @@ public boolean equals(Object o) { Objects.equals(this.locality, nodeDevice.locality); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(healthDescription, healthy, ID, locality); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -182,5 +217,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("HealthDescription"); + openapiFields.add("Healthy"); + openapiFields.add("ID"); + openapiFields.add("Locality"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDevice + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeDevice.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDevice is not found in the empty JSON string", NodeDevice.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDevice.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDevice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("HealthDescription") != null && !jsonObj.get("HealthDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HealthDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HealthDescription").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `Locality` + if (jsonObj.getAsJsonObject("Locality") != null) { + NodeDeviceLocality.validateJsonObject(jsonObj.getAsJsonObject("Locality")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDevice.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDevice' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDevice.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDevice value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDevice read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDevice given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDevice + * @throws IOException if the JSON string is invalid with respect to NodeDevice + */ + public static NodeDevice fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDevice.class); + } + + /** + * Convert an instance of NodeDevice to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceLocality.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceLocality.java index f4983e5f..7dfbef48 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceLocality.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceLocality.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeDeviceLocality */ @@ -33,6 +53,8 @@ public class NodeDeviceLocality { @SerializedName(SERIALIZED_NAME_PCI_BUS_I_D) private String pciBusID; + public NodeDeviceLocality() { + } public NodeDeviceLocality pciBusID(String pciBusID) { @@ -57,6 +79,7 @@ public void setPciBusID(String pciBusID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("PciBusID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDeviceLocality + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeDeviceLocality.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDeviceLocality is not found in the empty JSON string", NodeDeviceLocality.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDeviceLocality.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDeviceLocality` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("PciBusID") != null && !jsonObj.get("PciBusID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PciBusID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PciBusID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDeviceLocality.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDeviceLocality' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDeviceLocality.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDeviceLocality value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDeviceLocality read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDeviceLocality given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDeviceLocality + * @throws IOException if the JSON string is invalid with respect to NodeDeviceLocality + */ + public static NodeDeviceLocality fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDeviceLocality.class); + } + + /** + * Convert an instance of NodeDeviceLocality to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceResource.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceResource.java index 3981cb13..8800af66 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceResource.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDeviceResource.java @@ -30,6 +30,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeDeviceResource */ @@ -55,6 +75,8 @@ public class NodeDeviceResource { @SerializedName(SERIALIZED_NAME_VENDOR) private String vendor; + public NodeDeviceResource() { + } public NodeDeviceResource attributes(Map attributes) { @@ -64,7 +86,7 @@ public NodeDeviceResource attributes(Map attributes) { public NodeDeviceResource putAttributesItem(String key, Attribute attributesItem) { if (this.attributes == null) { - this.attributes = new HashMap(); + this.attributes = new HashMap<>(); } this.attributes.put(key, attributesItem); return this; @@ -95,7 +117,7 @@ public NodeDeviceResource instances(List instances) { public NodeDeviceResource addInstancesItem(NodeDevice instancesItem) { if (this.instances == null) { - this.instances = new ArrayList(); + this.instances = new ArrayList<>(); } this.instances.add(instancesItem); return this; @@ -187,6 +209,7 @@ public void setVendor(String vendor) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -232,5 +255,115 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Attributes"); + openapiFields.add("Instances"); + openapiFields.add("Name"); + openapiFields.add("Type"); + openapiFields.add("Vendor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDeviceResource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeDeviceResource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDeviceResource is not found in the empty JSON string", NodeDeviceResource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDeviceResource.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDeviceResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("Instances"); + if (jsonArrayinstances != null) { + // ensure the json data is an array + if (!jsonObj.get("Instances").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Instances` to be an array in the JSON string but got `%s`", jsonObj.get("Instances").toString())); + } + + // validate the optional field `Instances` (array) + for (int i = 0; i < jsonArrayinstances.size(); i++) { + NodeDevice.validateJsonObject(jsonArrayinstances.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if (jsonObj.get("Vendor") != null && !jsonObj.get("Vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Vendor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDeviceResource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDeviceResource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDeviceResource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDeviceResource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDeviceResource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDeviceResource given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDeviceResource + * @throws IOException if the JSON string is invalid with respect to NodeDeviceResource + */ + public static NodeDeviceResource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDeviceResource.class); + } + + /** + * Convert an instance of NodeDeviceResource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDiskResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDiskResources.java index 5a78f8be..1885ca99 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDiskResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDiskResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeDiskResources */ @@ -33,6 +53,8 @@ public class NodeDiskResources { @SerializedName(SERIALIZED_NAME_DISK_M_B) private Long diskMB; + public NodeDiskResources() { + } public NodeDiskResources diskMB(Long diskMB) { @@ -57,6 +79,7 @@ public void setDiskMB(Long diskMB) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DiskMB"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDiskResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeDiskResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDiskResources is not found in the empty JSON string", NodeDiskResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDiskResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDiskResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDiskResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDiskResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDiskResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDiskResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDiskResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDiskResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDiskResources + * @throws IOException if the JSON string is invalid with respect to NodeDiskResources + */ + public static NodeDiskResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDiskResources.class); + } + + /** + * Convert an instance of NodeDiskResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDrainUpdateResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDrainUpdateResponse.java index c5058e30..dbe6fc9e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDrainUpdateResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeDrainUpdateResponse.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeDrainUpdateResponse */ @@ -51,6 +71,8 @@ public class NodeDrainUpdateResponse { @SerializedName(SERIALIZED_NAME_REQUEST_TIME) private Long requestTime; + public NodeDrainUpdateResponse() { + } public NodeDrainUpdateResponse evalCreateIndex(Integer evalCreateIndex) { @@ -85,7 +107,7 @@ public NodeDrainUpdateResponse evalIDs(List evalIDs) { public NodeDrainUpdateResponse addEvalIDsItem(String evalIDsItem) { if (this.evalIDs == null) { - this.evalIDs = new ArrayList(); + this.evalIDs = new ArrayList<>(); } this.evalIDs.add(evalIDsItem); return this; @@ -181,6 +203,7 @@ public void setRequestTime(Long requestTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -226,5 +249,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalIDs"); + openapiFields.add("LastIndex"); + openapiFields.add("NodeModifyIndex"); + openapiFields.add("RequestTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDrainUpdateResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeDrainUpdateResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDrainUpdateResponse is not found in the empty JSON string", NodeDrainUpdateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDrainUpdateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDrainUpdateResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("EvalIDs") != null && !jsonObj.get("EvalIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalIDs` to be an array in the JSON string but got `%s`", jsonObj.get("EvalIDs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDrainUpdateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDrainUpdateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDrainUpdateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDrainUpdateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDrainUpdateResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDrainUpdateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDrainUpdateResponse + * @throws IOException if the JSON string is invalid with respect to NodeDrainUpdateResponse + */ + public static NodeDrainUpdateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDrainUpdateResponse.class); + } + + /** + * Convert an instance of NodeDrainUpdateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEligibilityUpdateResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEligibilityUpdateResponse.java index 2bac1088..ef36cac6 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEligibilityUpdateResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEligibilityUpdateResponse.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeEligibilityUpdateResponse */ @@ -51,6 +71,8 @@ public class NodeEligibilityUpdateResponse { @SerializedName(SERIALIZED_NAME_REQUEST_TIME) private Long requestTime; + public NodeEligibilityUpdateResponse() { + } public NodeEligibilityUpdateResponse evalCreateIndex(Integer evalCreateIndex) { @@ -85,7 +107,7 @@ public NodeEligibilityUpdateResponse evalIDs(List evalIDs) { public NodeEligibilityUpdateResponse addEvalIDsItem(String evalIDsItem) { if (this.evalIDs == null) { - this.evalIDs = new ArrayList(); + this.evalIDs = new ArrayList<>(); } this.evalIDs.add(evalIDsItem); return this; @@ -181,6 +203,7 @@ public void setRequestTime(Long requestTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -226,5 +249,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalIDs"); + openapiFields.add("LastIndex"); + openapiFields.add("NodeModifyIndex"); + openapiFields.add("RequestTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeEligibilityUpdateResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeEligibilityUpdateResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeEligibilityUpdateResponse is not found in the empty JSON string", NodeEligibilityUpdateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeEligibilityUpdateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeEligibilityUpdateResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("EvalIDs") != null && !jsonObj.get("EvalIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalIDs` to be an array in the JSON string but got `%s`", jsonObj.get("EvalIDs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeEligibilityUpdateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeEligibilityUpdateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeEligibilityUpdateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeEligibilityUpdateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeEligibilityUpdateResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeEligibilityUpdateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeEligibilityUpdateResponse + * @throws IOException if the JSON string is invalid with respect to NodeEligibilityUpdateResponse + */ + public static NodeEligibilityUpdateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeEligibilityUpdateResponse.class); + } + + /** + * Convert an instance of NodeEligibilityUpdateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEvent.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEvent.java index 19c8b26b..d1d2bff0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEvent.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeEvent.java @@ -23,10 +23,31 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NodeEvent @@ -53,6 +74,8 @@ public class NodeEvent { @SerializedName(SERIALIZED_NAME_TIMESTAMP) private OffsetDateTime timestamp; + public NodeEvent() { + } public NodeEvent createIndex(Integer createIndex) { @@ -87,7 +110,7 @@ public NodeEvent details(Map details) { public NodeEvent putDetailsItem(String key, String detailsItem) { if (this.details == null) { - this.details = new HashMap(); + this.details = new HashMap<>(); } this.details.put(key, detailsItem); return this; @@ -179,6 +202,7 @@ public void setTimestamp(OffsetDateTime timestamp) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -195,11 +219,22 @@ public boolean equals(Object o) { Objects.equals(this.timestamp, nodeEvent.timestamp); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(createIndex, details, message, subsystem, timestamp); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -224,5 +259,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Details"); + openapiFields.add("Message"); + openapiFields.add("Subsystem"); + openapiFields.add("Timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeEvent + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeEvent.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeEvent is not found in the empty JSON string", NodeEvent.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeEvent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeEvent` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Message") != null && !jsonObj.get("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + if (jsonObj.get("Subsystem") != null && !jsonObj.get("Subsystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Subsystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Subsystem").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeEvent + * @throws IOException if the JSON string is invalid with respect to NodeEvent + */ + public static NodeEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeEvent.class); + } + + /** + * Convert an instance of NodeEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeListStub.java index f1995e19..e012f415 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeListStub.java @@ -30,6 +30,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NodeListStub @@ -104,6 +125,8 @@ public class NodeListStub { @SerializedName(SERIALIZED_NAME_VERSION) private String version; + public NodeListStub() { + } public NodeListStub address(String address) { @@ -136,7 +159,7 @@ public NodeListStub attributes(Map attributes) { public NodeListStub putAttributesItem(String key, String attributesItem) { if (this.attributes == null) { - this.attributes = new HashMap(); + this.attributes = new HashMap<>(); } this.attributes.put(key, attributesItem); return this; @@ -238,7 +261,7 @@ public NodeListStub drivers(Map drivers) { public NodeListStub putDriversItem(String key, DriverInfo driversItem) { if (this.drivers == null) { - this.drivers = new HashMap(); + this.drivers = new HashMap<>(); } this.drivers.put(key, driversItem); return this; @@ -516,6 +539,7 @@ public void setVersion(String version) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -544,11 +568,22 @@ public boolean equals(Object o) { Objects.equals(this.version, nodeListStub.version); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(address, attributes, createIndex, datacenter, drain, drivers, ID, lastDrain, modifyIndex, name, nodeClass, nodeResources, reservedResources, schedulingEligibility, status, statusDescription, version); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -585,5 +620,145 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Address"); + openapiFields.add("Attributes"); + openapiFields.add("CreateIndex"); + openapiFields.add("Datacenter"); + openapiFields.add("Drain"); + openapiFields.add("Drivers"); + openapiFields.add("ID"); + openapiFields.add("LastDrain"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + openapiFields.add("NodeClass"); + openapiFields.add("NodeResources"); + openapiFields.add("ReservedResources"); + openapiFields.add("SchedulingEligibility"); + openapiFields.add("Status"); + openapiFields.add("StatusDescription"); + openapiFields.add("Version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeListStub is not found in the empty JSON string", NodeListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Address") != null && !jsonObj.get("Address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address").toString())); + } + if (jsonObj.get("Datacenter") != null && !jsonObj.get("Datacenter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Datacenter").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + // validate the optional field `LastDrain` + if (jsonObj.getAsJsonObject("LastDrain") != null) { + DrainMetadata.validateJsonObject(jsonObj.getAsJsonObject("LastDrain")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("NodeClass") != null && !jsonObj.get("NodeClass").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeClass` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeClass").toString())); + } + // validate the optional field `NodeResources` + if (jsonObj.getAsJsonObject("NodeResources") != null) { + NodeResources.validateJsonObject(jsonObj.getAsJsonObject("NodeResources")); + } + // validate the optional field `ReservedResources` + if (jsonObj.getAsJsonObject("ReservedResources") != null) { + NodeReservedResources.validateJsonObject(jsonObj.getAsJsonObject("ReservedResources")); + } + if (jsonObj.get("SchedulingEligibility") != null && !jsonObj.get("SchedulingEligibility").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SchedulingEligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SchedulingEligibility").toString())); + } + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + if (jsonObj.get("StatusDescription") != null && !jsonObj.get("StatusDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StatusDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StatusDescription").toString())); + } + if (jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeListStub + * @throws IOException if the JSON string is invalid with respect to NodeListStub + */ + public static NodeListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeListStub.class); + } + + /** + * Convert an instance of NodeListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeMemoryResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeMemoryResources.java index 4d5db37b..f739e5c2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeMemoryResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeMemoryResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeMemoryResources */ @@ -33,6 +53,8 @@ public class NodeMemoryResources { @SerializedName(SERIALIZED_NAME_MEMORY_M_B) private Long memoryMB; + public NodeMemoryResources() { + } public NodeMemoryResources memoryMB(Long memoryMB) { @@ -57,6 +79,7 @@ public void setMemoryMB(Long memoryMB) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("MemoryMB"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeMemoryResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeMemoryResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeMemoryResources is not found in the empty JSON string", NodeMemoryResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeMemoryResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeMemoryResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeMemoryResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeMemoryResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeMemoryResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeMemoryResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeMemoryResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeMemoryResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeMemoryResources + * @throws IOException if the JSON string is invalid with respect to NodeMemoryResources + */ + public static NodeMemoryResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeMemoryResources.class); + } + + /** + * Convert an instance of NodeMemoryResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodePurgeResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodePurgeResponse.java index 75d7578b..ff2ecbb0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodePurgeResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodePurgeResponse.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodePurgeResponse */ @@ -43,6 +63,8 @@ public class NodePurgeResponse { @SerializedName(SERIALIZED_NAME_NODE_MODIFY_INDEX) private Integer nodeModifyIndex; + public NodePurgeResponse() { + } public NodePurgeResponse evalCreateIndex(Integer evalCreateIndex) { @@ -77,7 +99,7 @@ public NodePurgeResponse evalIDs(List evalIDs) { public NodePurgeResponse addEvalIDsItem(String evalIDsItem) { if (this.evalIDs == null) { - this.evalIDs = new ArrayList(); + this.evalIDs = new ArrayList<>(); } this.evalIDs.add(evalIDsItem); return this; @@ -125,6 +147,7 @@ public void setNodeModifyIndex(Integer nodeModifyIndex) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -166,5 +189,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalIDs"); + openapiFields.add("NodeModifyIndex"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodePurgeResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodePurgeResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodePurgeResponse is not found in the empty JSON string", NodePurgeResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodePurgeResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodePurgeResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("EvalIDs") != null && !jsonObj.get("EvalIDs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalIDs` to be an array in the JSON string but got `%s`", jsonObj.get("EvalIDs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodePurgeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodePurgeResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodePurgeResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodePurgeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodePurgeResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodePurgeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodePurgeResponse + * @throws IOException if the JSON string is invalid with respect to NodePurgeResponse + */ + public static NodePurgeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodePurgeResponse.class); + } + + /** + * Convert an instance of NodePurgeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedCpuResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedCpuResources.java index 38448675..4ba588d9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedCpuResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedCpuResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeReservedCpuResources */ @@ -33,6 +53,8 @@ public class NodeReservedCpuResources { @SerializedName(SERIALIZED_NAME_CPU_SHARES) private Integer cpuShares; + public NodeReservedCpuResources() { + } public NodeReservedCpuResources cpuShares(Integer cpuShares) { @@ -59,6 +81,7 @@ public void setCpuShares(Integer cpuShares) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -96,5 +119,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CpuShares"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeReservedCpuResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeReservedCpuResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeReservedCpuResources is not found in the empty JSON string", NodeReservedCpuResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeReservedCpuResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeReservedCpuResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeReservedCpuResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeReservedCpuResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeReservedCpuResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeReservedCpuResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeReservedCpuResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeReservedCpuResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeReservedCpuResources + * @throws IOException if the JSON string is invalid with respect to NodeReservedCpuResources + */ + public static NodeReservedCpuResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeReservedCpuResources.class); + } + + /** + * Convert an instance of NodeReservedCpuResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedDiskResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedDiskResources.java index 469a4d6b..807ef3a0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedDiskResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedDiskResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeReservedDiskResources */ @@ -33,6 +53,8 @@ public class NodeReservedDiskResources { @SerializedName(SERIALIZED_NAME_DISK_M_B) private Integer diskMB; + public NodeReservedDiskResources() { + } public NodeReservedDiskResources diskMB(Integer diskMB) { @@ -59,6 +81,7 @@ public void setDiskMB(Integer diskMB) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -96,5 +119,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DiskMB"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeReservedDiskResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeReservedDiskResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeReservedDiskResources is not found in the empty JSON string", NodeReservedDiskResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeReservedDiskResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeReservedDiskResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeReservedDiskResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeReservedDiskResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeReservedDiskResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeReservedDiskResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeReservedDiskResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeReservedDiskResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeReservedDiskResources + * @throws IOException if the JSON string is invalid with respect to NodeReservedDiskResources + */ + public static NodeReservedDiskResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeReservedDiskResources.class); + } + + /** + * Convert an instance of NodeReservedDiskResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedMemoryResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedMemoryResources.java index 942f5aa1..e6d756a0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedMemoryResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedMemoryResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeReservedMemoryResources */ @@ -33,6 +53,8 @@ public class NodeReservedMemoryResources { @SerializedName(SERIALIZED_NAME_MEMORY_M_B) private Integer memoryMB; + public NodeReservedMemoryResources() { + } public NodeReservedMemoryResources memoryMB(Integer memoryMB) { @@ -59,6 +81,7 @@ public void setMemoryMB(Integer memoryMB) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -96,5 +119,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("MemoryMB"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeReservedMemoryResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeReservedMemoryResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeReservedMemoryResources is not found in the empty JSON string", NodeReservedMemoryResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeReservedMemoryResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeReservedMemoryResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeReservedMemoryResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeReservedMemoryResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeReservedMemoryResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeReservedMemoryResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeReservedMemoryResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeReservedMemoryResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeReservedMemoryResources + * @throws IOException if the JSON string is invalid with respect to NodeReservedMemoryResources + */ + public static NodeReservedMemoryResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeReservedMemoryResources.class); + } + + /** + * Convert an instance of NodeReservedMemoryResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedNetworkResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedNetworkResources.java index 51a22682..b8e8d989 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedNetworkResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedNetworkResources.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeReservedNetworkResources */ @@ -33,6 +53,8 @@ public class NodeReservedNetworkResources { @SerializedName(SERIALIZED_NAME_RESERVED_HOST_PORTS) private String reservedHostPorts; + public NodeReservedNetworkResources() { + } public NodeReservedNetworkResources reservedHostPorts(String reservedHostPorts) { @@ -57,6 +79,7 @@ public void setReservedHostPorts(String reservedHostPorts) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ReservedHostPorts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeReservedNetworkResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeReservedNetworkResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeReservedNetworkResources is not found in the empty JSON string", NodeReservedNetworkResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeReservedNetworkResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeReservedNetworkResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ReservedHostPorts") != null && !jsonObj.get("ReservedHostPorts").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ReservedHostPorts` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ReservedHostPorts").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeReservedNetworkResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeReservedNetworkResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeReservedNetworkResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeReservedNetworkResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeReservedNetworkResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeReservedNetworkResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeReservedNetworkResources + * @throws IOException if the JSON string is invalid with respect to NodeReservedNetworkResources + */ + public static NodeReservedNetworkResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeReservedNetworkResources.class); + } + + /** + * Convert an instance of NodeReservedNetworkResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedResources.java index 4ab6a112..ed80990f 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeReservedResources.java @@ -27,6 +27,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NodeReservedResources @@ -49,6 +70,8 @@ public class NodeReservedResources { @SerializedName(SERIALIZED_NAME_NETWORKS) private NodeReservedNetworkResources networks; + public NodeReservedResources() { + } public NodeReservedResources cpu(NodeReservedCpuResources cpu) { @@ -142,6 +165,7 @@ public void setNetworks(NodeReservedNetworkResources networks) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -157,11 +181,22 @@ public boolean equals(Object o) { Objects.equals(this.networks, nodeReservedResources.networks); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(cpu, disk, memory, networks); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -185,5 +220,109 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Cpu"); + openapiFields.add("Disk"); + openapiFields.add("Memory"); + openapiFields.add("Networks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeReservedResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeReservedResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeReservedResources is not found in the empty JSON string", NodeReservedResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeReservedResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeReservedResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Cpu` + if (jsonObj.getAsJsonObject("Cpu") != null) { + NodeReservedCpuResources.validateJsonObject(jsonObj.getAsJsonObject("Cpu")); + } + // validate the optional field `Disk` + if (jsonObj.getAsJsonObject("Disk") != null) { + NodeReservedDiskResources.validateJsonObject(jsonObj.getAsJsonObject("Disk")); + } + // validate the optional field `Memory` + if (jsonObj.getAsJsonObject("Memory") != null) { + NodeReservedMemoryResources.validateJsonObject(jsonObj.getAsJsonObject("Memory")); + } + // validate the optional field `Networks` + if (jsonObj.getAsJsonObject("Networks") != null) { + NodeReservedNetworkResources.validateJsonObject(jsonObj.getAsJsonObject("Networks")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeReservedResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeReservedResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeReservedResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeReservedResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeReservedResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeReservedResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeReservedResources + * @throws IOException if the JSON string is invalid with respect to NodeReservedResources + */ + public static NodeReservedResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeReservedResources.class); + } + + /** + * Convert an instance of NodeReservedResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeResources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeResources.java index f0ee7b7a..c0889260 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeResources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeResources.java @@ -30,6 +30,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NodeResources @@ -64,6 +85,8 @@ public class NodeResources { @SerializedName(SERIALIZED_NAME_NETWORKS) private List networks = null; + public NodeResources() { + } public NodeResources cpu(NodeCpuResources cpu) { @@ -96,7 +119,7 @@ public NodeResources devices(List devices) { public NodeResources addDevicesItem(NodeDeviceResource devicesItem) { if (this.devices == null) { - this.devices = new ArrayList(); + this.devices = new ArrayList<>(); } this.devices.add(devicesItem); return this; @@ -219,7 +242,7 @@ public NodeResources networks(List networks) { public NodeResources addNetworksItem(NetworkResource networksItem) { if (this.networks == null) { - this.networks = new ArrayList(); + this.networks = new ArrayList<>(); } this.networks.add(networksItem); return this; @@ -242,6 +265,7 @@ public void setNetworks(List networks) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -260,11 +284,22 @@ public boolean equals(Object o) { Objects.equals(this.networks, nodeResources.networks); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(cpu, devices, disk, maxDynamicPort, memory, minDynamicPort, networks); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -291,5 +326,132 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Cpu"); + openapiFields.add("Devices"); + openapiFields.add("Disk"); + openapiFields.add("MaxDynamicPort"); + openapiFields.add("Memory"); + openapiFields.add("MinDynamicPort"); + openapiFields.add("Networks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeResources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeResources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeResources is not found in the empty JSON string", NodeResources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `Cpu` + if (jsonObj.getAsJsonObject("Cpu") != null) { + NodeCpuResources.validateJsonObject(jsonObj.getAsJsonObject("Cpu")); + } + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("Devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("Devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Devices` to be an array in the JSON string but got `%s`", jsonObj.get("Devices").toString())); + } + + // validate the optional field `Devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + NodeDeviceResource.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; + } + // validate the optional field `Disk` + if (jsonObj.getAsJsonObject("Disk") != null) { + NodeDiskResources.validateJsonObject(jsonObj.getAsJsonObject("Disk")); + } + // validate the optional field `Memory` + if (jsonObj.getAsJsonObject("Memory") != null) { + NodeMemoryResources.validateJsonObject(jsonObj.getAsJsonObject("Memory")); + } + JsonArray jsonArraynetworks = jsonObj.getAsJsonArray("Networks"); + if (jsonArraynetworks != null) { + // ensure the json data is an array + if (!jsonObj.get("Networks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Networks` to be an array in the JSON string but got `%s`", jsonObj.get("Networks").toString())); + } + + // validate the optional field `Networks` (array) + for (int i = 0; i < jsonArraynetworks.size(); i++) { + NetworkResource.validateJsonObject(jsonArraynetworks.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeResources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeResources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeResources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeResources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeResources + * @throws IOException if the JSON string is invalid with respect to NodeResources + */ + public static NodeResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeResources.class); + } + + /** + * Convert an instance of NodeResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeScoreMeta.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeScoreMeta.java index 9b44c377..e5ce77e6 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeScoreMeta.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeScoreMeta.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeScoreMeta */ @@ -44,6 +64,8 @@ public class NodeScoreMeta { @SerializedName(SERIALIZED_NAME_SCORES) private Map scores = null; + public NodeScoreMeta() { + } public NodeScoreMeta nodeID(String nodeID) { @@ -99,7 +121,7 @@ public NodeScoreMeta scores(Map scores) { public NodeScoreMeta putScoresItem(String key, Double scoresItem) { if (this.scores == null) { - this.scores = new HashMap(); + this.scores = new HashMap<>(); } this.scores.put(key, scoresItem); return this; @@ -122,6 +144,7 @@ public void setScores(Map scores) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -163,5 +186,95 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("NodeID"); + openapiFields.add("NormScore"); + openapiFields.add("Scores"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeScoreMeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeScoreMeta.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeScoreMeta is not found in the empty JSON string", NodeScoreMeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeScoreMeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeScoreMeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeScoreMeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeScoreMeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeScoreMeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeScoreMeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeScoreMeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeScoreMeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeScoreMeta + * @throws IOException if the JSON string is invalid with respect to NodeScoreMeta + */ + public static NodeScoreMeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeScoreMeta.class); + } + + /** + * Convert an instance of NodeScoreMeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateDrainRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateDrainRequest.java index 8d194c0d..0861d35e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateDrainRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateDrainRequest.java @@ -27,6 +27,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * NodeUpdateDrainRequest @@ -49,6 +70,8 @@ public class NodeUpdateDrainRequest { @SerializedName(SERIALIZED_NAME_NODE_I_D) private String nodeID; + public NodeUpdateDrainRequest() { + } public NodeUpdateDrainRequest drainSpec(DrainSpec drainSpec) { @@ -104,7 +127,7 @@ public NodeUpdateDrainRequest meta(Map meta) { public NodeUpdateDrainRequest putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -150,6 +173,7 @@ public void setNodeID(String nodeID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -165,11 +189,22 @@ public boolean equals(Object o) { Objects.equals(this.nodeID, nodeUpdateDrainRequest.nodeID); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(drainSpec, markEligible, meta, nodeID); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -193,5 +228,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DrainSpec"); + openapiFields.add("MarkEligible"); + openapiFields.add("Meta"); + openapiFields.add("NodeID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeUpdateDrainRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeUpdateDrainRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeUpdateDrainRequest is not found in the empty JSON string", NodeUpdateDrainRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeUpdateDrainRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeUpdateDrainRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `DrainSpec` + if (jsonObj.getAsJsonObject("DrainSpec") != null) { + DrainSpec.validateJsonObject(jsonObj.getAsJsonObject("DrainSpec")); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeUpdateDrainRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeUpdateDrainRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeUpdateDrainRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeUpdateDrainRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeUpdateDrainRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeUpdateDrainRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeUpdateDrainRequest + * @throws IOException if the JSON string is invalid with respect to NodeUpdateDrainRequest + */ + public static NodeUpdateDrainRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeUpdateDrainRequest.class); + } + + /** + * Convert an instance of NodeUpdateDrainRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateEligibilityRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateEligibilityRequest.java index d51f079f..4723e7c2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateEligibilityRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/NodeUpdateEligibilityRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * NodeUpdateEligibilityRequest */ @@ -37,6 +57,8 @@ public class NodeUpdateEligibilityRequest { @SerializedName(SERIALIZED_NAME_NODE_I_D) private String nodeID; + public NodeUpdateEligibilityRequest() { + } public NodeUpdateEligibilityRequest eligibility(String eligibility) { @@ -84,6 +106,7 @@ public void setNodeID(String nodeID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +146,97 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Eligibility"); + openapiFields.add("NodeID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeUpdateEligibilityRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NodeUpdateEligibilityRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeUpdateEligibilityRequest is not found in the empty JSON string", NodeUpdateEligibilityRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeUpdateEligibilityRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeUpdateEligibilityRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Eligibility") != null && !jsonObj.get("Eligibility").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Eligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Eligibility").toString())); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeUpdateEligibilityRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeUpdateEligibilityRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeUpdateEligibilityRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeUpdateEligibilityRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeUpdateEligibilityRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeUpdateEligibilityRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeUpdateEligibilityRequest + * @throws IOException if the JSON string is invalid with respect to NodeUpdateEligibilityRequest + */ + public static NodeUpdateEligibilityRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeUpdateEligibilityRequest.class); + } + + /** + * Convert an instance of NodeUpdateEligibilityRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ObjectDiff.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ObjectDiff.java index f0d76e24..bb920f06 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ObjectDiff.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ObjectDiff.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ObjectDiff */ @@ -48,6 +68,8 @@ public class ObjectDiff { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public ObjectDiff() { + } public ObjectDiff fields(List fields) { @@ -57,7 +79,7 @@ public ObjectDiff fields(List fields) { public ObjectDiff addFieldsItem(FieldDiff fieldsItem) { if (this.fields == null) { - this.fields = new ArrayList(); + this.fields = new ArrayList<>(); } this.fields.add(fieldsItem); return this; @@ -111,7 +133,7 @@ public ObjectDiff objects(List objects) { public ObjectDiff addObjectsItem(ObjectDiff objectsItem) { if (this.objects == null) { - this.objects = new ArrayList(); + this.objects = new ArrayList<>(); } this.objects.add(objectsItem); return this; @@ -157,6 +179,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -200,5 +223,123 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Fields"); + openapiFields.add("Name"); + openapiFields.add("Objects"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ObjectDiff + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ObjectDiff.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectDiff is not found in the empty JSON string", ObjectDiff.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ObjectDiff.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ObjectDiff` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("Fields"); + if (jsonArrayfields != null) { + // ensure the json data is an array + if (!jsonObj.get("Fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Fields` to be an array in the JSON string but got `%s`", jsonObj.get("Fields").toString())); + } + + // validate the optional field `Fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + FieldDiff.validateJsonObject(jsonArrayfields.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + JsonArray jsonArrayobjects = jsonObj.getAsJsonArray("Objects"); + if (jsonArrayobjects != null) { + // ensure the json data is an array + if (!jsonObj.get("Objects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Objects` to be an array in the JSON string but got `%s`", jsonObj.get("Objects").toString())); + } + + // validate the optional field `Objects` (array) + for (int i = 0; i < jsonArrayobjects.size(); i++) { + ObjectDiff.validateJsonObject(jsonArrayobjects.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectDiff.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectDiff' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectDiff.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectDiff value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ObjectDiff read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectDiff given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectDiff + * @throws IOException if the JSON string is invalid with respect to ObjectDiff + */ + public static ObjectDiff fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectDiff.class); + } + + /** + * Convert an instance of ObjectDiff to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeToken.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeToken.java index d8fba8cb..12251062 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeToken.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeToken.java @@ -23,7 +23,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * OneTimeToken @@ -50,6 +71,8 @@ public class OneTimeToken { @SerializedName(SERIALIZED_NAME_ONE_TIME_SECRET_I_D) private String oneTimeSecretID; + public OneTimeToken() { + } public OneTimeToken accessorID(String accessorID) { @@ -170,6 +193,7 @@ public void setOneTimeSecretID(String oneTimeSecretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -186,11 +210,22 @@ public boolean equals(Object o) { Objects.equals(this.oneTimeSecretID, oneTimeToken.oneTimeSecretID); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(accessorID, createIndex, expiresAt, modifyIndex, oneTimeSecretID); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -215,5 +250,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AccessorID"); + openapiFields.add("CreateIndex"); + openapiFields.add("ExpiresAt"); + openapiFields.add("ModifyIndex"); + openapiFields.add("OneTimeSecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OneTimeToken + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OneTimeToken.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OneTimeToken is not found in the empty JSON string", OneTimeToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OneTimeToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OneTimeToken` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AccessorID") != null && !jsonObj.get("AccessorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessorID").toString())); + } + if (jsonObj.get("OneTimeSecretID") != null && !jsonObj.get("OneTimeSecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OneTimeSecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OneTimeSecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OneTimeToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OneTimeToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OneTimeToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OneTimeToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OneTimeToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OneTimeToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of OneTimeToken + * @throws IOException if the JSON string is invalid with respect to OneTimeToken + */ + public static OneTimeToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OneTimeToken.class); + } + + /** + * Convert an instance of OneTimeToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeTokenExchangeRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeTokenExchangeRequest.java index f6e47929..736c5c11 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeTokenExchangeRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/OneTimeTokenExchangeRequest.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * OneTimeTokenExchangeRequest */ @@ -33,6 +53,8 @@ public class OneTimeTokenExchangeRequest { @SerializedName(SERIALIZED_NAME_ONE_TIME_SECRET_I_D) private String oneTimeSecretID; + public OneTimeTokenExchangeRequest() { + } public OneTimeTokenExchangeRequest oneTimeSecretID(String oneTimeSecretID) { @@ -57,6 +79,7 @@ public void setOneTimeSecretID(String oneTimeSecretID) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -94,5 +117,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("OneTimeSecretID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OneTimeTokenExchangeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OneTimeTokenExchangeRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OneTimeTokenExchangeRequest is not found in the empty JSON string", OneTimeTokenExchangeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OneTimeTokenExchangeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OneTimeTokenExchangeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("OneTimeSecretID") != null && !jsonObj.get("OneTimeSecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OneTimeSecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OneTimeSecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OneTimeTokenExchangeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OneTimeTokenExchangeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OneTimeTokenExchangeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OneTimeTokenExchangeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OneTimeTokenExchangeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OneTimeTokenExchangeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OneTimeTokenExchangeRequest + * @throws IOException if the JSON string is invalid with respect to OneTimeTokenExchangeRequest + */ + public static OneTimeTokenExchangeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OneTimeTokenExchangeRequest.class); + } + + /** + * Convert an instance of OneTimeTokenExchangeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/OperatorHealthReply.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/OperatorHealthReply.java index 09c8577d..2071aff3 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/OperatorHealthReply.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/OperatorHealthReply.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * OperatorHealthReply */ @@ -44,6 +64,8 @@ public class OperatorHealthReply { @SerializedName(SERIALIZED_NAME_SERVERS) private List servers = null; + public OperatorHealthReply() { + } public OperatorHealthReply failureTolerance(Integer failureTolerance) { @@ -99,7 +121,7 @@ public OperatorHealthReply servers(List servers) { public OperatorHealthReply addServersItem(ServerHealth serversItem) { if (this.servers == null) { - this.servers = new ArrayList(); + this.servers = new ArrayList<>(); } this.servers.add(serversItem); return this; @@ -122,6 +144,7 @@ public void setServers(List servers) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -163,5 +186,104 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("FailureTolerance"); + openapiFields.add("Healthy"); + openapiFields.add("Servers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OperatorHealthReply + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OperatorHealthReply.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OperatorHealthReply is not found in the empty JSON string", OperatorHealthReply.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OperatorHealthReply.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OperatorHealthReply` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayservers = jsonObj.getAsJsonArray("Servers"); + if (jsonArrayservers != null) { + // ensure the json data is an array + if (!jsonObj.get("Servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Servers` to be an array in the JSON string but got `%s`", jsonObj.get("Servers").toString())); + } + + // validate the optional field `Servers` (array) + for (int i = 0; i < jsonArrayservers.size(); i++) { + ServerHealth.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OperatorHealthReply.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OperatorHealthReply' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OperatorHealthReply.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OperatorHealthReply value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OperatorHealthReply read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OperatorHealthReply given an JSON string + * + * @param jsonString JSON string + * @return An instance of OperatorHealthReply + * @throws IOException if the JSON string is invalid with respect to OperatorHealthReply + */ + public static OperatorHealthReply fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OperatorHealthReply.class); + } + + /** + * Convert an instance of OperatorHealthReply to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ParameterizedJobConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ParameterizedJobConfig.java index 3c8c57a7..2b1ec5fe 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ParameterizedJobConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ParameterizedJobConfig.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ParameterizedJobConfig */ @@ -43,6 +63,8 @@ public class ParameterizedJobConfig { @SerializedName(SERIALIZED_NAME_PAYLOAD) private String payload; + public ParameterizedJobConfig() { + } public ParameterizedJobConfig metaOptional(List metaOptional) { @@ -52,7 +74,7 @@ public ParameterizedJobConfig metaOptional(List metaOptional) { public ParameterizedJobConfig addMetaOptionalItem(String metaOptionalItem) { if (this.metaOptional == null) { - this.metaOptional = new ArrayList(); + this.metaOptional = new ArrayList<>(); } this.metaOptional.add(metaOptionalItem); return this; @@ -83,7 +105,7 @@ public ParameterizedJobConfig metaRequired(List metaRequired) { public ParameterizedJobConfig addMetaRequiredItem(String metaRequiredItem) { if (this.metaRequired == null) { - this.metaRequired = new ArrayList(); + this.metaRequired = new ArrayList<>(); } this.metaRequired.add(metaRequiredItem); return this; @@ -129,6 +151,7 @@ public void setPayload(String payload) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -170,5 +193,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("MetaOptional"); + openapiFields.add("MetaRequired"); + openapiFields.add("Payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ParameterizedJobConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ParameterizedJobConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ParameterizedJobConfig is not found in the empty JSON string", ParameterizedJobConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ParameterizedJobConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ParameterizedJobConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("MetaOptional") != null && !jsonObj.get("MetaOptional").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MetaOptional` to be an array in the JSON string but got `%s`", jsonObj.get("MetaOptional").toString())); + } + // ensure the json data is an array + if (jsonObj.get("MetaRequired") != null && !jsonObj.get("MetaRequired").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MetaRequired` to be an array in the JSON string but got `%s`", jsonObj.get("MetaRequired").toString())); + } + if (jsonObj.get("Payload") != null && !jsonObj.get("Payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ParameterizedJobConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ParameterizedJobConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ParameterizedJobConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ParameterizedJobConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ParameterizedJobConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ParameterizedJobConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ParameterizedJobConfig + * @throws IOException if the JSON string is invalid with respect to ParameterizedJobConfig + */ + public static ParameterizedJobConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ParameterizedJobConfig.class); + } + + /** + * Convert an instance of ParameterizedJobConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicConfig.java index 6d257bf6..be8a1848 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicConfig.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * PeriodicConfig */ @@ -49,6 +69,8 @@ public class PeriodicConfig { @SerializedName(SERIALIZED_NAME_TIME_ZONE) private String timeZone; + public PeriodicConfig() { + } public PeriodicConfig enabled(Boolean enabled) { @@ -165,6 +187,7 @@ public void setTimeZone(String timeZone) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -210,5 +233,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Enabled"); + openapiFields.add("ProhibitOverlap"); + openapiFields.add("Spec"); + openapiFields.add("SpecType"); + openapiFields.add("TimeZone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PeriodicConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PeriodicConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PeriodicConfig is not found in the empty JSON string", PeriodicConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PeriodicConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PeriodicConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Spec") != null && !jsonObj.get("Spec").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Spec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Spec").toString())); + } + if (jsonObj.get("SpecType") != null && !jsonObj.get("SpecType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SpecType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SpecType").toString())); + } + if (jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PeriodicConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PeriodicConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PeriodicConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PeriodicConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PeriodicConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of PeriodicConfig + * @throws IOException if the JSON string is invalid with respect to PeriodicConfig + */ + public static PeriodicConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PeriodicConfig.class); + } + + /** + * Convert an instance of PeriodicConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicForceResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicForceResponse.java index 62e374ef..1f89d21b 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicForceResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/PeriodicForceResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * PeriodicForceResponse */ @@ -41,6 +61,8 @@ public class PeriodicForceResponse { @SerializedName(SERIALIZED_NAME_INDEX) private Integer index; + public PeriodicForceResponse() { + } public PeriodicForceResponse evalCreateIndex(Integer evalCreateIndex) { @@ -115,6 +137,7 @@ public void setIndex(Integer index) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -156,5 +179,95 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EvalCreateIndex"); + openapiFields.add("EvalID"); + openapiFields.add("Index"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PeriodicForceResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PeriodicForceResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PeriodicForceResponse is not found in the empty JSON string", PeriodicForceResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PeriodicForceResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PeriodicForceResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PeriodicForceResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PeriodicForceResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PeriodicForceResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PeriodicForceResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PeriodicForceResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PeriodicForceResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PeriodicForceResponse + * @throws IOException if the JSON string is invalid with respect to PeriodicForceResponse + */ + public static PeriodicForceResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PeriodicForceResponse.class); + } + + /** + * Convert an instance of PeriodicForceResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/PlanAnnotations.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/PlanAnnotations.java index 08b95d3b..05ad569e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/PlanAnnotations.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/PlanAnnotations.java @@ -30,6 +30,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * PlanAnnotations */ @@ -43,6 +63,8 @@ public class PlanAnnotations { @SerializedName(SERIALIZED_NAME_PREEMPTED_ALLOCS) private List preemptedAllocs = null; + public PlanAnnotations() { + } public PlanAnnotations desiredTGUpdates(Map desiredTGUpdates) { @@ -52,7 +74,7 @@ public PlanAnnotations desiredTGUpdates(Map desiredTGUpd public PlanAnnotations putDesiredTGUpdatesItem(String key, DesiredUpdates desiredTGUpdatesItem) { if (this.desiredTGUpdates == null) { - this.desiredTGUpdates = new HashMap(); + this.desiredTGUpdates = new HashMap<>(); } this.desiredTGUpdates.put(key, desiredTGUpdatesItem); return this; @@ -83,7 +105,7 @@ public PlanAnnotations preemptedAllocs(List preemptedAllocs) public PlanAnnotations addPreemptedAllocsItem(AllocationListStub preemptedAllocsItem) { if (this.preemptedAllocs == null) { - this.preemptedAllocs = new ArrayList(); + this.preemptedAllocs = new ArrayList<>(); } this.preemptedAllocs.add(preemptedAllocsItem); return this; @@ -106,6 +128,7 @@ public void setPreemptedAllocs(List preemptedAllocs) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -145,5 +168,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("DesiredTGUpdates"); + openapiFields.add("PreemptedAllocs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PlanAnnotations + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PlanAnnotations.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PlanAnnotations is not found in the empty JSON string", PlanAnnotations.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PlanAnnotations.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PlanAnnotations` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraypreemptedAllocs = jsonObj.getAsJsonArray("PreemptedAllocs"); + if (jsonArraypreemptedAllocs != null) { + // ensure the json data is an array + if (!jsonObj.get("PreemptedAllocs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreemptedAllocs` to be an array in the JSON string but got `%s`", jsonObj.get("PreemptedAllocs").toString())); + } + + // validate the optional field `PreemptedAllocs` (array) + for (int i = 0; i < jsonArraypreemptedAllocs.size(); i++) { + AllocationListStub.validateJsonObject(jsonArraypreemptedAllocs.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PlanAnnotations.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PlanAnnotations' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PlanAnnotations.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PlanAnnotations value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PlanAnnotations read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PlanAnnotations given an JSON string + * + * @param jsonString JSON string + * @return An instance of PlanAnnotations + * @throws IOException if the JSON string is invalid with respect to PlanAnnotations + */ + public static PlanAnnotations fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PlanAnnotations.class); + } + + /** + * Convert an instance of PlanAnnotations to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/PointValue.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/PointValue.java index 90705d1a..d4bb5790 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/PointValue.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/PointValue.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * PointValue */ @@ -39,6 +59,8 @@ public class PointValue { @SerializedName(SERIALIZED_NAME_POINTS) private List points = null; + public PointValue() { + } public PointValue name(String name) { @@ -71,7 +93,7 @@ public PointValue points(List points) { public PointValue addPointsItem(Float pointsItem) { if (this.points == null) { - this.points = new ArrayList(); + this.points = new ArrayList<>(); } this.points.add(pointsItem); return this; @@ -94,6 +116,7 @@ public void setPoints(List points) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -133,5 +156,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Name"); + openapiFields.add("Points"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PointValue + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PointValue.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PointValue is not found in the empty JSON string", PointValue.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PointValue.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PointValue` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Points") != null && !jsonObj.get("Points").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Points` to be an array in the JSON string but got `%s`", jsonObj.get("Points").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PointValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PointValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PointValue.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PointValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PointValue read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PointValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of PointValue + * @throws IOException if the JSON string is invalid with respect to PointValue + */ + public static PointValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PointValue.class); + } + + /** + * Convert an instance of PointValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Port.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Port.java index 4d78e01e..031cc31c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Port.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Port.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Port */ @@ -45,6 +65,8 @@ public class Port { @SerializedName(SERIALIZED_NAME_VALUE) private Integer value; + public Port() { + } public Port hostNetwork(String hostNetwork) { @@ -138,6 +160,7 @@ public void setValue(Integer value) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("HostNetwork"); + openapiFields.add("Label"); + openapiFields.add("To"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Port + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Port.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Port is not found in the empty JSON string", Port.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Port.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Port` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("HostNetwork") != null && !jsonObj.get("HostNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HostNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HostNetwork").toString())); + } + if (jsonObj.get("Label") != null && !jsonObj.get("Label").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Label").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Port.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Port' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Port.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Port value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Port read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Port given an JSON string + * + * @param jsonString JSON string + * @return An instance of Port + * @throws IOException if the JSON string is invalid with respect to Port + */ + public static Port fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Port.class); + } + + /** + * Convert an instance of Port to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/PortMapping.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/PortMapping.java index 45cf2530..a0599164 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/PortMapping.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/PortMapping.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * PortMapping */ @@ -45,6 +65,8 @@ public class PortMapping { @SerializedName(SERIALIZED_NAME_VALUE) private Integer value; + public PortMapping() { + } public PortMapping hostIP(String hostIP) { @@ -138,6 +160,7 @@ public void setValue(Integer value) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("HostIP"); + openapiFields.add("Label"); + openapiFields.add("To"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PortMapping + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PortMapping.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PortMapping is not found in the empty JSON string", PortMapping.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PortMapping.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PortMapping` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("HostIP") != null && !jsonObj.get("HostIP").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HostIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HostIP").toString())); + } + if (jsonObj.get("Label") != null && !jsonObj.get("Label").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Label").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PortMapping.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PortMapping' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PortMapping.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PortMapping value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PortMapping read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PortMapping given an JSON string + * + * @param jsonString JSON string + * @return An instance of PortMapping + * @throws IOException if the JSON string is invalid with respect to PortMapping + */ + public static PortMapping fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PortMapping.class); + } + + /** + * Convert an instance of PortMapping to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/PreemptionConfig.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/PreemptionConfig.java index 72e541f6..46387fb7 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/PreemptionConfig.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/PreemptionConfig.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * PreemptionConfig */ @@ -45,6 +65,8 @@ public class PreemptionConfig { @SerializedName(SERIALIZED_NAME_SYSTEM_SCHEDULER_ENABLED) private Boolean systemSchedulerEnabled; + public PreemptionConfig() { + } public PreemptionConfig batchSchedulerEnabled(Boolean batchSchedulerEnabled) { @@ -138,6 +160,7 @@ public void setSystemSchedulerEnabled(Boolean systemSchedulerEnabled) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("BatchSchedulerEnabled"); + openapiFields.add("ServiceSchedulerEnabled"); + openapiFields.add("SysBatchSchedulerEnabled"); + openapiFields.add("SystemSchedulerEnabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PreemptionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PreemptionConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PreemptionConfig is not found in the empty JSON string", PreemptionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PreemptionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PreemptionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PreemptionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreemptionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PreemptionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PreemptionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PreemptionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PreemptionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of PreemptionConfig + * @throws IOException if the JSON string is invalid with respect to PreemptionConfig + */ + public static PreemptionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreemptionConfig.class); + } + + /** + * Convert an instance of PreemptionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaLimit.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaLimit.java index 90ef721d..a38b8cbf 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaLimit.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaLimit.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * QuotaLimit @@ -42,6 +63,8 @@ public class QuotaLimit { @SerializedName(SERIALIZED_NAME_REGION_LIMIT) private Resources regionLimit; + public QuotaLimit() { + } public QuotaLimit hash(byte[] hash) { @@ -112,6 +135,7 @@ public void setRegionLimit(Resources regionLimit) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -126,11 +150,22 @@ public boolean equals(Object o) { Objects.equals(this.regionLimit, quotaLimit.regionLimit); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(Arrays.hashCode(hash), region, regionLimit); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -153,5 +188,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Hash"); + openapiFields.add("Region"); + openapiFields.add("RegionLimit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuotaLimit + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (QuotaLimit.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in QuotaLimit is not found in the empty JSON string", QuotaLimit.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QuotaLimit.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QuotaLimit` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + // validate the optional field `RegionLimit` + if (jsonObj.getAsJsonObject("RegionLimit") != null) { + Resources.validateJsonObject(jsonObj.getAsJsonObject("RegionLimit")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuotaLimit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuotaLimit' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuotaLimit.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuotaLimit value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuotaLimit read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QuotaLimit given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuotaLimit + * @throws IOException if the JSON string is invalid with respect to QuotaLimit + */ + public static QuotaLimit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuotaLimit.class); + } + + /** + * Convert an instance of QuotaLimit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaSpec.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaSpec.java index f0549f08..aba21f95 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaSpec.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/QuotaSpec.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * QuotaSpec */ @@ -52,6 +72,8 @@ public class QuotaSpec { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public QuotaSpec() { + } public QuotaSpec createIndex(Integer createIndex) { @@ -109,7 +131,7 @@ public QuotaSpec limits(List limits) { public QuotaSpec addLimitsItem(QuotaLimit limitsItem) { if (this.limits == null) { - this.limits = new ArrayList(); + this.limits = new ArrayList<>(); } this.limits.add(limitsItem); return this; @@ -180,6 +202,7 @@ public void setName(String name) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -225,5 +248,112 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Description"); + openapiFields.add("Limits"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuotaSpec + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (QuotaSpec.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in QuotaSpec is not found in the empty JSON string", QuotaSpec.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QuotaSpec.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QuotaSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + JsonArray jsonArraylimits = jsonObj.getAsJsonArray("Limits"); + if (jsonArraylimits != null) { + // ensure the json data is an array + if (!jsonObj.get("Limits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Limits` to be an array in the JSON string but got `%s`", jsonObj.get("Limits").toString())); + } + + // validate the optional field `Limits` (array) + for (int i = 0; i < jsonArraylimits.size(); i++) { + QuotaLimit.validateJsonObject(jsonArraylimits.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuotaSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuotaSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuotaSpec.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuotaSpec value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuotaSpec read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QuotaSpec given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuotaSpec + * @throws IOException if the JSON string is invalid with respect to QuotaSpec + */ + public static QuotaSpec fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuotaSpec.class); + } + + /** + * Convert an instance of QuotaSpec to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftConfiguration.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftConfiguration.java index d64cc6e2..57568b40 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftConfiguration.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftConfiguration.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * RaftConfiguration */ @@ -40,6 +60,8 @@ public class RaftConfiguration { @SerializedName(SERIALIZED_NAME_SERVERS) private List servers = null; + public RaftConfiguration() { + } public RaftConfiguration index(Integer index) { @@ -74,7 +96,7 @@ public RaftConfiguration servers(List servers) { public RaftConfiguration addServersItem(RaftServer serversItem) { if (this.servers == null) { - this.servers = new ArrayList(); + this.servers = new ArrayList<>(); } this.servers.add(serversItem); return this; @@ -97,6 +119,7 @@ public void setServers(List servers) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -136,5 +159,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Index"); + openapiFields.add("Servers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RaftConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RaftConfiguration.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RaftConfiguration is not found in the empty JSON string", RaftConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RaftConfiguration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RaftConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayservers = jsonObj.getAsJsonArray("Servers"); + if (jsonArrayservers != null) { + // ensure the json data is an array + if (!jsonObj.get("Servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Servers` to be an array in the JSON string but got `%s`", jsonObj.get("Servers").toString())); + } + + // validate the optional field `Servers` (array) + for (int i = 0; i < jsonArrayservers.size(); i++) { + RaftServer.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RaftConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaftConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaftConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RaftConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RaftConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaftConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaftConfiguration + * @throws IOException if the JSON string is invalid with respect to RaftConfiguration + */ + public static RaftConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaftConfiguration.class); + } + + /** + * Convert an instance of RaftConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftServer.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftServer.java index ae19dd65..4cd9d7e5 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftServer.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/RaftServer.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * RaftServer */ @@ -53,6 +73,8 @@ public class RaftServer { @SerializedName(SERIALIZED_NAME_VOTER) private Boolean voter; + public RaftServer() { + } public RaftServer address(String address) { @@ -192,6 +214,7 @@ public void setVoter(Boolean voter) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -239,5 +262,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Address"); + openapiFields.add("ID"); + openapiFields.add("Leader"); + openapiFields.add("Node"); + openapiFields.add("RaftProtocol"); + openapiFields.add("Voter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RaftServer + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RaftServer.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RaftServer is not found in the empty JSON string", RaftServer.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RaftServer.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RaftServer` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Address") != null && !jsonObj.get("Address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Node") != null && !jsonObj.get("Node").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Node` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Node").toString())); + } + if (jsonObj.get("RaftProtocol") != null && !jsonObj.get("RaftProtocol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RaftProtocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RaftProtocol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RaftServer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaftServer' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaftServer.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RaftServer value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RaftServer read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaftServer given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaftServer + * @throws IOException if the JSON string is invalid with respect to RaftServer + */ + public static RaftServer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaftServer.class); + } + + /** + * Convert an instance of RaftServer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/RequestedDevice.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/RequestedDevice.java index 7cbc45ee..cdda98bb 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/RequestedDevice.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/RequestedDevice.java @@ -28,6 +28,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * RequestedDevice */ @@ -49,6 +69,8 @@ public class RequestedDevice { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public RequestedDevice() { + } public RequestedDevice affinities(List affinities) { @@ -58,7 +80,7 @@ public RequestedDevice affinities(List affinities) { public RequestedDevice addAffinitiesItem(Affinity affinitiesItem) { if (this.affinities == null) { - this.affinities = new ArrayList(); + this.affinities = new ArrayList<>(); } this.affinities.add(affinitiesItem); return this; @@ -89,7 +111,7 @@ public RequestedDevice constraints(List constraints) { public RequestedDevice addConstraintsItem(Constraint constraintsItem) { if (this.constraints == null) { - this.constraints = new ArrayList(); + this.constraints = new ArrayList<>(); } this.constraints.add(constraintsItem); return this; @@ -160,6 +182,7 @@ public void setName(String name) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -203,5 +226,120 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Affinities"); + openapiFields.add("Constraints"); + openapiFields.add("Count"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RequestedDevice + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RequestedDevice.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestedDevice is not found in the empty JSON string", RequestedDevice.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RequestedDevice.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestedDevice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayaffinities = jsonObj.getAsJsonArray("Affinities"); + if (jsonArrayaffinities != null) { + // ensure the json data is an array + if (!jsonObj.get("Affinities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Affinities` to be an array in the JSON string but got `%s`", jsonObj.get("Affinities").toString())); + } + + // validate the optional field `Affinities` (array) + for (int i = 0; i < jsonArrayaffinities.size(); i++) { + Affinity.validateJsonObject(jsonArrayaffinities.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArrayconstraints = jsonObj.getAsJsonArray("Constraints"); + if (jsonArrayconstraints != null) { + // ensure the json data is an array + if (!jsonObj.get("Constraints").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Constraints` to be an array in the JSON string but got `%s`", jsonObj.get("Constraints").toString())); + } + + // validate the optional field `Constraints` (array) + for (int i = 0; i < jsonArrayconstraints.size(); i++) { + Constraint.validateJsonObject(jsonArrayconstraints.get(i).getAsJsonObject()); + }; + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestedDevice.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestedDevice' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestedDevice.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestedDevice value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestedDevice read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestedDevice given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestedDevice + * @throws IOException if the JSON string is invalid with respect to RequestedDevice + */ + public static RequestedDevice fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestedDevice.class); + } + + /** + * Convert an instance of RequestedDevice to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleEvent.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleEvent.java index b0c6d350..7adc60af 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleEvent.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleEvent.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * RescheduleEvent */ @@ -41,6 +61,8 @@ public class RescheduleEvent { @SerializedName(SERIALIZED_NAME_RESCHEDULE_TIME) private Long rescheduleTime; + public RescheduleEvent() { + } public RescheduleEvent prevAllocID(String prevAllocID) { @@ -111,6 +133,7 @@ public void setRescheduleTime(Long rescheduleTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,5 +175,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("PrevAllocID"); + openapiFields.add("PrevNodeID"); + openapiFields.add("RescheduleTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RescheduleEvent + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RescheduleEvent.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RescheduleEvent is not found in the empty JSON string", RescheduleEvent.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RescheduleEvent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RescheduleEvent` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("PrevAllocID") != null && !jsonObj.get("PrevAllocID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrevAllocID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrevAllocID").toString())); + } + if (jsonObj.get("PrevNodeID") != null && !jsonObj.get("PrevNodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrevNodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrevNodeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RescheduleEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RescheduleEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RescheduleEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RescheduleEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RescheduleEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RescheduleEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of RescheduleEvent + * @throws IOException if the JSON string is invalid with respect to RescheduleEvent + */ + public static RescheduleEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RescheduleEvent.class); + } + + /** + * Convert an instance of RescheduleEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ReschedulePolicy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ReschedulePolicy.java index 45a23b73..320535e2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ReschedulePolicy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ReschedulePolicy.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ReschedulePolicy */ @@ -53,6 +73,8 @@ public class ReschedulePolicy { @SerializedName(SERIALIZED_NAME_UNLIMITED) private Boolean unlimited; + public ReschedulePolicy() { + } public ReschedulePolicy attempts(Integer attempts) { @@ -192,6 +214,7 @@ public void setUnlimited(Boolean unlimited) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -239,5 +262,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Attempts"); + openapiFields.add("Delay"); + openapiFields.add("DelayFunction"); + openapiFields.add("Interval"); + openapiFields.add("MaxDelay"); + openapiFields.add("Unlimited"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReschedulePolicy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReschedulePolicy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReschedulePolicy is not found in the empty JSON string", ReschedulePolicy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReschedulePolicy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReschedulePolicy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("DelayFunction") != null && !jsonObj.get("DelayFunction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DelayFunction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DelayFunction").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReschedulePolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReschedulePolicy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReschedulePolicy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReschedulePolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReschedulePolicy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReschedulePolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReschedulePolicy + * @throws IOException if the JSON string is invalid with respect to ReschedulePolicy + */ + public static ReschedulePolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReschedulePolicy.class); + } + + /** + * Convert an instance of ReschedulePolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleTracker.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleTracker.java index 70b2e371..d1e951ff 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleTracker.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/RescheduleTracker.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * RescheduleTracker */ @@ -36,6 +56,8 @@ public class RescheduleTracker { @SerializedName(SERIALIZED_NAME_EVENTS) private List events = null; + public RescheduleTracker() { + } public RescheduleTracker events(List events) { @@ -45,7 +67,7 @@ public RescheduleTracker events(List events) { public RescheduleTracker addEventsItem(RescheduleEvent eventsItem) { if (this.events == null) { - this.events = new ArrayList(); + this.events = new ArrayList<>(); } this.events.add(eventsItem); return this; @@ -68,6 +90,7 @@ public void setEvents(List events) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -105,5 +128,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Events"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RescheduleTracker + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RescheduleTracker.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RescheduleTracker is not found in the empty JSON string", RescheduleTracker.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RescheduleTracker.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RescheduleTracker` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("Events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("Events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Events` to be an array in the JSON string but got `%s`", jsonObj.get("Events").toString())); + } + + // validate the optional field `Events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + RescheduleEvent.validateJsonObject(jsonArrayevents.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RescheduleTracker.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RescheduleTracker' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RescheduleTracker.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RescheduleTracker value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RescheduleTracker read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RescheduleTracker given an JSON string + * + * @param jsonString JSON string + * @return An instance of RescheduleTracker + * @throws IOException if the JSON string is invalid with respect to RescheduleTracker + */ + public static RescheduleTracker fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RescheduleTracker.class); + } + + /** + * Convert an instance of RescheduleTracker to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Resources.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Resources.java index a22feffd..bd750f54 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Resources.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Resources.java @@ -28,6 +28,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Resources */ @@ -65,6 +85,8 @@ public class Resources { @SerializedName(SERIALIZED_NAME_NETWORKS) private List networks = null; + public Resources() { + } public Resources CPU(Integer CPU) { @@ -120,7 +142,7 @@ public Resources devices(List devices) { public Resources addDevicesItem(RequestedDevice devicesItem) { if (this.devices == null) { - this.devices = new ArrayList(); + this.devices = new ArrayList<>(); } this.devices.add(devicesItem); return this; @@ -243,7 +265,7 @@ public Resources networks(List networks) { public Resources addNetworksItem(NetworkResource networksItem) { if (this.networks == null) { - this.networks = new ArrayList(); + this.networks = new ArrayList<>(); } this.networks.add(networksItem); return this; @@ -266,6 +288,7 @@ public void setNetworks(List networks) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -317,5 +340,121 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CPU"); + openapiFields.add("Cores"); + openapiFields.add("Devices"); + openapiFields.add("DiskMB"); + openapiFields.add("IOPS"); + openapiFields.add("MemoryMB"); + openapiFields.add("MemoryMaxMB"); + openapiFields.add("Networks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Resources + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Resources.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Resources is not found in the empty JSON string", Resources.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Resources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Resources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("Devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("Devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Devices` to be an array in the JSON string but got `%s`", jsonObj.get("Devices").toString())); + } + + // validate the optional field `Devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + RequestedDevice.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraynetworks = jsonObj.getAsJsonArray("Networks"); + if (jsonArraynetworks != null) { + // ensure the json data is an array + if (!jsonObj.get("Networks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Networks` to be an array in the JSON string but got `%s`", jsonObj.get("Networks").toString())); + } + + // validate the optional field `Networks` (array) + for (int i = 0; i < jsonArraynetworks.size(); i++) { + NetworkResource.validateJsonObject(jsonArraynetworks.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Resources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Resources' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Resources.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Resources value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Resources read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Resources given an JSON string + * + * @param jsonString JSON string + * @return An instance of Resources + * @throws IOException if the JSON string is invalid with respect to Resources + */ + public static Resources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Resources.class); + } + + /** + * Convert an instance of Resources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/RestartPolicy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/RestartPolicy.java index 62992f62..403f4b4e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/RestartPolicy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/RestartPolicy.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * RestartPolicy */ @@ -45,6 +65,8 @@ public class RestartPolicy { @SerializedName(SERIALIZED_NAME_MODE) private String mode; + public RestartPolicy() { + } public RestartPolicy attempts(Integer attempts) { @@ -138,6 +160,7 @@ public void setMode(String mode) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -181,5 +204,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Attempts"); + openapiFields.add("Delay"); + openapiFields.add("Interval"); + openapiFields.add("Mode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RestartPolicy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RestartPolicy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RestartPolicy is not found in the empty JSON string", RestartPolicy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestartPolicy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RestartPolicy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Mode") != null && !jsonObj.get("Mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Mode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestartPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestartPolicy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RestartPolicy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RestartPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestartPolicy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RestartPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestartPolicy + * @throws IOException if the JSON string is invalid with respect to RestartPolicy + */ + public static RestartPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestartPolicy.class); + } + + /** + * Convert an instance of RestartPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SampledValue.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SampledValue.java index 0da2f353..fd7885c7 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SampledValue.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SampledValue.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * SampledValue */ @@ -68,6 +88,8 @@ public class SampledValue { @SerializedName(SERIALIZED_NAME_SUM) private Double sum; + public SampledValue() { + } public SampledValue count(Integer count) { @@ -100,7 +122,7 @@ public SampledValue labels(Map labels) { public SampledValue putLabelsItem(String key, String labelsItem) { if (this.labels == null) { - this.labels = new HashMap(); + this.labels = new HashMap<>(); } this.labels.put(key, labelsItem); return this; @@ -284,6 +306,7 @@ public void setSum(Double sum) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -337,5 +360,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Count"); + openapiFields.add("Labels"); + openapiFields.add("Max"); + openapiFields.add("Mean"); + openapiFields.add("Min"); + openapiFields.add("Name"); + openapiFields.add("Rate"); + openapiFields.add("Stddev"); + openapiFields.add("Sum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SampledValue + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SampledValue.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SampledValue is not found in the empty JSON string", SampledValue.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SampledValue.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SampledValue` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SampledValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SampledValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SampledValue.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SampledValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SampledValue read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SampledValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of SampledValue + * @throws IOException if the JSON string is invalid with respect to SampledValue + */ + public static SampledValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SampledValue.class); + } + + /** + * Convert an instance of SampledValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingEvent.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingEvent.java index b3b99741..54243ba2 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingEvent.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingEvent.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ScalingEvent */ @@ -64,6 +84,8 @@ public class ScalingEvent { @SerializedName(SERIALIZED_NAME_TIME) private Integer time; + public ScalingEvent() { + } public ScalingEvent count(Long count) { @@ -190,7 +212,7 @@ public ScalingEvent meta(Map meta) { public ScalingEvent putMetaItem(String key, Object metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -261,6 +283,7 @@ public void setTime(Integer time) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -312,5 +335,103 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Count"); + openapiFields.add("CreateIndex"); + openapiFields.add("Error"); + openapiFields.add("EvalID"); + openapiFields.add("Message"); + openapiFields.add("Meta"); + openapiFields.add("PreviousCount"); + openapiFields.add("Time"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ScalingEvent + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ScalingEvent.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ScalingEvent is not found in the empty JSON string", ScalingEvent.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ScalingEvent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScalingEvent` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("EvalID") != null && !jsonObj.get("EvalID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EvalID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EvalID").toString())); + } + if (jsonObj.get("Message") != null && !jsonObj.get("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScalingEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScalingEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ScalingEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ScalingEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScalingEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ScalingEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScalingEvent + * @throws IOException if the JSON string is invalid with respect to ScalingEvent + */ + public static ScalingEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScalingEvent.class); + } + + /** + * Convert an instance of ScalingEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicy.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicy.java index c314374d..f9c606bf 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicy.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicy.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ScalingPolicy */ @@ -72,6 +92,8 @@ public class ScalingPolicy { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public ScalingPolicy() { + } public ScalingPolicy createIndex(Integer createIndex) { @@ -246,7 +268,7 @@ public ScalingPolicy policy(Map policy) { public ScalingPolicy putPolicyItem(String key, Object policyItem) { if (this.policy == null) { - this.policy = new HashMap(); + this.policy = new HashMap<>(); } this.policy.put(key, policyItem); return this; @@ -277,7 +299,7 @@ public ScalingPolicy target(Map target) { public ScalingPolicy putTargetItem(String key, String targetItem) { if (this.target == null) { - this.target = new HashMap(); + this.target = new HashMap<>(); } this.target.put(key, targetItem); return this; @@ -323,6 +345,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -378,5 +401,108 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Enabled"); + openapiFields.add("ID"); + openapiFields.add("Max"); + openapiFields.add("Min"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Namespace"); + openapiFields.add("Policy"); + openapiFields.add("Target"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ScalingPolicy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ScalingPolicy.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ScalingPolicy is not found in the empty JSON string", ScalingPolicy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ScalingPolicy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScalingPolicy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScalingPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScalingPolicy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ScalingPolicy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ScalingPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScalingPolicy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ScalingPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScalingPolicy + * @throws IOException if the JSON string is invalid with respect to ScalingPolicy + */ + public static ScalingPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScalingPolicy.class); + } + + /** + * Convert an instance of ScalingPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicyListStub.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicyListStub.java index b09984e6..43f0d75a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicyListStub.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingPolicyListStub.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ScalingPolicyListStub */ @@ -56,6 +76,8 @@ public class ScalingPolicyListStub { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public ScalingPolicyListStub() { + } public ScalingPolicyListStub createIndex(Integer createIndex) { @@ -161,7 +183,7 @@ public ScalingPolicyListStub target(Map target) { public ScalingPolicyListStub putTargetItem(String key, String targetItem) { if (this.target == null) { - this.target = new HashMap(); + this.target = new HashMap<>(); } this.target.put(key, targetItem); return this; @@ -207,6 +229,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -254,5 +277,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("Enabled"); + openapiFields.add("ID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Target"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ScalingPolicyListStub + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ScalingPolicyListStub.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ScalingPolicyListStub is not found in the empty JSON string", ScalingPolicyListStub.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ScalingPolicyListStub.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScalingPolicyListStub` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScalingPolicyListStub.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScalingPolicyListStub' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ScalingPolicyListStub.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ScalingPolicyListStub value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScalingPolicyListStub read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ScalingPolicyListStub given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScalingPolicyListStub + * @throws IOException if the JSON string is invalid with respect to ScalingPolicyListStub + */ + public static ScalingPolicyListStub fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScalingPolicyListStub.class); + } + + /** + * Convert an instance of ScalingPolicyListStub to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingRequest.java index ad8340f3..21a3fd6d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ScalingRequest.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ScalingRequest */ @@ -68,6 +88,8 @@ public class ScalingRequest { @SerializedName(SERIALIZED_NAME_TARGET) private Map target = null; + public ScalingRequest() { + } public ScalingRequest count(Long count) { @@ -146,7 +168,7 @@ public ScalingRequest meta(Map meta) { public ScalingRequest putMetaItem(String key, Object metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -269,7 +291,7 @@ public ScalingRequest target(Map target) { public ScalingRequest putTargetItem(String key, String targetItem) { if (this.target == null) { - this.target = new HashMap(); + this.target = new HashMap<>(); } this.target.put(key, targetItem); return this; @@ -292,6 +314,7 @@ public void setTarget(Map target) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -345,5 +368,110 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Count"); + openapiFields.add("Error"); + openapiFields.add("Message"); + openapiFields.add("Meta"); + openapiFields.add("Namespace"); + openapiFields.add("PolicyOverride"); + openapiFields.add("Region"); + openapiFields.add("SecretID"); + openapiFields.add("Target"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ScalingRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ScalingRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ScalingRequest is not found in the empty JSON string", ScalingRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ScalingRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScalingRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Message") != null && !jsonObj.get("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if (jsonObj.get("SecretID") != null && !jsonObj.get("SecretID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScalingRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScalingRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ScalingRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ScalingRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScalingRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ScalingRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScalingRequest + * @throws IOException if the JSON string is invalid with respect to ScalingRequest + */ + public static ScalingRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScalingRequest.class); + } + + /** + * Convert an instance of ScalingRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfiguration.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfiguration.java index 4aaa9ea3..193814f0 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfiguration.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfiguration.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * SchedulerConfiguration @@ -58,6 +79,8 @@ public class SchedulerConfiguration { @SerializedName(SERIALIZED_NAME_SCHEDULER_ALGORITHM) private String schedulerAlgorithm; + public SchedulerConfiguration() { + } public SchedulerConfiguration createIndex(Integer createIndex) { @@ -224,6 +247,7 @@ public void setSchedulerAlgorithm(String schedulerAlgorithm) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -242,11 +266,22 @@ public boolean equals(Object o) { Objects.equals(this.schedulerAlgorithm, schedulerConfiguration.schedulerAlgorithm); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(createIndex, memoryOversubscriptionEnabled, modifyIndex, pauseEvalBroker, preemptionConfig, rejectJobRegistration, schedulerAlgorithm); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -273,5 +308,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CreateIndex"); + openapiFields.add("MemoryOversubscriptionEnabled"); + openapiFields.add("ModifyIndex"); + openapiFields.add("PreemptionConfig"); + openapiFields.add("RejectJobRegistration"); + openapiFields.add("SchedulerAlgorithm"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SchedulerConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SchedulerConfiguration.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SchedulerConfiguration is not found in the empty JSON string", SchedulerConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SchedulerConfiguration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchedulerConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `PreemptionConfig` + if (jsonObj.getAsJsonObject("PreemptionConfig") != null) { + PreemptionConfig.validateJsonObject(jsonObj.getAsJsonObject("PreemptionConfig")); + } + if (jsonObj.get("SchedulerAlgorithm") != null && !jsonObj.get("SchedulerAlgorithm").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SchedulerAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SchedulerAlgorithm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchedulerConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchedulerConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchedulerConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchedulerConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchedulerConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchedulerConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchedulerConfiguration + * @throws IOException if the JSON string is invalid with respect to SchedulerConfiguration + */ + public static SchedulerConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchedulerConfiguration.class); + } + + /** + * Convert an instance of SchedulerConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfigurationResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfigurationResponse.java index 9cdee256..51dad05c 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfigurationResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerConfigurationResponse.java @@ -24,6 +24,27 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * SchedulerConfigurationResponse @@ -54,6 +75,8 @@ public class SchedulerConfigurationResponse { @SerializedName(SERIALIZED_NAME_SCHEDULER_CONFIG) private SchedulerConfiguration schedulerConfig; + public SchedulerConfigurationResponse() { + } public SchedulerConfigurationResponse knownLeader(Boolean knownLeader) { @@ -195,6 +218,7 @@ public void setSchedulerConfig(SchedulerConfiguration schedulerConfig) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -212,11 +236,22 @@ public boolean equals(Object o) { Objects.equals(this.schedulerConfig, schedulerConfigurationResponse.schedulerConfig); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(knownLeader, lastContact, lastIndex, nextToken, requestTime, schedulerConfig); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -242,5 +277,102 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("SchedulerConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SchedulerConfigurationResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SchedulerConfigurationResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SchedulerConfigurationResponse is not found in the empty JSON string", SchedulerConfigurationResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SchedulerConfigurationResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchedulerConfigurationResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + // validate the optional field `SchedulerConfig` + if (jsonObj.getAsJsonObject("SchedulerConfig") != null) { + SchedulerConfiguration.validateJsonObject(jsonObj.getAsJsonObject("SchedulerConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchedulerConfigurationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchedulerConfigurationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchedulerConfigurationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchedulerConfigurationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchedulerConfigurationResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchedulerConfigurationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchedulerConfigurationResponse + * @throws IOException if the JSON string is invalid with respect to SchedulerConfigurationResponse + */ + public static SchedulerConfigurationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchedulerConfigurationResponse.class); + } + + /** + * Convert an instance of SchedulerConfigurationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerSetConfigurationResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerSetConfigurationResponse.java index 018888cf..160da6fd 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerSetConfigurationResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SchedulerSetConfigurationResponse.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * SchedulerSetConfigurationResponse */ @@ -41,6 +61,8 @@ public class SchedulerSetConfigurationResponse { @SerializedName(SERIALIZED_NAME_UPDATED) private Boolean updated; + public SchedulerSetConfigurationResponse() { + } public SchedulerSetConfigurationResponse lastIndex(Integer lastIndex) { @@ -113,6 +135,7 @@ public void setUpdated(Boolean updated) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -154,5 +177,92 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("LastIndex"); + openapiFields.add("RequestTime"); + openapiFields.add("Updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SchedulerSetConfigurationResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SchedulerSetConfigurationResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SchedulerSetConfigurationResponse is not found in the empty JSON string", SchedulerSetConfigurationResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SchedulerSetConfigurationResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchedulerSetConfigurationResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchedulerSetConfigurationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchedulerSetConfigurationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchedulerSetConfigurationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchedulerSetConfigurationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchedulerSetConfigurationResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchedulerSetConfigurationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchedulerSetConfigurationResponse + * @throws IOException if the JSON string is invalid with respect to SchedulerSetConfigurationResponse + */ + public static SchedulerSetConfigurationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchedulerSetConfigurationResponse.class); + } + + /** + * Convert an instance of SchedulerSetConfigurationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchRequest.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchRequest.java index 51a6fd1d..fb487036 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchRequest.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchRequest.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * SearchRequest */ @@ -88,6 +108,8 @@ public class SearchRequest { @SerializedName(SERIALIZED_NAME_WAIT_TIME) private Long waitTime; + public SearchRequest() { + } public SearchRequest allowStale(Boolean allowStale) { @@ -189,7 +211,7 @@ public SearchRequest headers(Map headers) { public SearchRequest putHeadersItem(String key, String headersItem) { if (this.headers == null) { - this.headers = new HashMap(); + this.headers = new HashMap<>(); } this.headers.put(key, headersItem); return this; @@ -266,7 +288,7 @@ public SearchRequest params(Map params) { public SearchRequest putParamsItem(String key, String paramsItem) { if (this.params == null) { - this.params = new HashMap(); + this.params = new HashMap<>(); } this.params.put(key, paramsItem); return this; @@ -429,6 +451,7 @@ public void setWaitTime(Long waitTime) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -492,5 +515,124 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AllowStale"); + openapiFields.add("AuthToken"); + openapiFields.add("Context"); + openapiFields.add("Filter"); + openapiFields.add("Headers"); + openapiFields.add("Namespace"); + openapiFields.add("NextToken"); + openapiFields.add("Params"); + openapiFields.add("PerPage"); + openapiFields.add("Prefix"); + openapiFields.add("Region"); + openapiFields.add("Reverse"); + openapiFields.add("WaitIndex"); + openapiFields.add("WaitTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SearchRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SearchRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SearchRequest is not found in the empty JSON string", SearchRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SearchRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SearchRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AuthToken") != null && !jsonObj.get("AuthToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthToken").toString())); + } + if (jsonObj.get("Context") != null && !jsonObj.get("Context").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Context` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Context").toString())); + } + if (jsonObj.get("Filter") != null && !jsonObj.get("Filter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Filter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Filter").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + if (jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if (jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SearchRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SearchRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SearchRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SearchRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SearchRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SearchRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SearchRequest + * @throws IOException if the JSON string is invalid with respect to SearchRequest + */ + public static SearchRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SearchRequest.class); + } + + /** + * Convert an instance of SearchRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchResponse.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchResponse.java index b2018e37..5416ac5a 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchResponse.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SearchResponse.java @@ -27,6 +27,26 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * SearchResponse */ @@ -60,6 +80,8 @@ public class SearchResponse { @SerializedName(SERIALIZED_NAME_TRUNCATIONS) private Map truncations = null; + public SearchResponse() { + } public SearchResponse knownLeader(Boolean knownLeader) { @@ -140,7 +162,7 @@ public SearchResponse matches(Map> matches) { public SearchResponse putMatchesItem(String key, List matchesItem) { if (this.matches == null) { - this.matches = new HashMap>(); + this.matches = new HashMap<>(); } this.matches.put(key, matchesItem); return this; @@ -217,7 +239,7 @@ public SearchResponse truncations(Map truncations) { public SearchResponse putTruncationsItem(String key, Boolean truncationsItem) { if (this.truncations == null) { - this.truncations = new HashMap(); + this.truncations = new HashMap<>(); } this.truncations.put(key, truncationsItem); return this; @@ -240,6 +262,7 @@ public void setTruncations(Map truncations) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -289,5 +312,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("KnownLeader"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("Matches"); + openapiFields.add("NextToken"); + openapiFields.add("RequestTime"); + openapiFields.add("Truncations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SearchResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SearchResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SearchResponse is not found in the empty JSON string", SearchResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SearchResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SearchResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("NextToken") != null && !jsonObj.get("NextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SearchResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SearchResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SearchResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SearchResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SearchResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SearchResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SearchResponse + * @throws IOException if the JSON string is invalid with respect to SearchResponse + */ + public static SearchResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SearchResponse.class); + } + + /** + * Convert an instance of SearchResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ServerHealth.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ServerHealth.java index 1a9d3216..2440c0bf 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ServerHealth.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ServerHealth.java @@ -23,7 +23,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ServerHealth @@ -78,6 +99,8 @@ public class ServerHealth { @SerializedName(SERIALIZED_NAME_VOTER) private Boolean voter; + public ServerHealth() { + } public ServerHealth address(String address) { @@ -359,6 +382,7 @@ public void setVoter(Boolean voter) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -382,11 +406,22 @@ public boolean equals(Object o) { Objects.equals(this.voter, serverHealth.voter); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(address, healthy, ID, lastContact, lastIndex, lastTerm, leader, name, serfStatus, stableSince, version, voter); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -418,5 +453,116 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Address"); + openapiFields.add("Healthy"); + openapiFields.add("ID"); + openapiFields.add("LastContact"); + openapiFields.add("LastIndex"); + openapiFields.add("LastTerm"); + openapiFields.add("Leader"); + openapiFields.add("Name"); + openapiFields.add("SerfStatus"); + openapiFields.add("StableSince"); + openapiFields.add("Version"); + openapiFields.add("Voter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ServerHealth + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ServerHealth.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ServerHealth is not found in the empty JSON string", ServerHealth.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ServerHealth.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServerHealth` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Address") != null && !jsonObj.get("Address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("SerfStatus") != null && !jsonObj.get("SerfStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SerfStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SerfStatus").toString())); + } + if (jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServerHealth.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerHealth' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServerHealth.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServerHealth value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServerHealth read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ServerHealth given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServerHealth + * @throws IOException if the JSON string is invalid with respect to ServerHealth + */ + public static ServerHealth fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerHealth.class); + } + + /** + * Convert an instance of ServerHealth to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Service.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Service.java index e996d37a..d42f5760 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Service.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Service.java @@ -30,6 +30,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Service @@ -100,6 +121,8 @@ public class Service { @SerializedName(SERIALIZED_NAME_TASK_NAME) private String taskName; + public Service() { + } public Service address(String address) { @@ -155,7 +178,7 @@ public Service canaryMeta(Map canaryMeta) { public Service putCanaryMetaItem(String key, String canaryMetaItem) { if (this.canaryMeta == null) { - this.canaryMeta = new HashMap(); + this.canaryMeta = new HashMap<>(); } this.canaryMeta.put(key, canaryMetaItem); return this; @@ -186,7 +209,7 @@ public Service canaryTags(List canaryTags) { public Service addCanaryTagsItem(String canaryTagsItem) { if (this.canaryTags == null) { - this.canaryTags = new ArrayList(); + this.canaryTags = new ArrayList<>(); } this.canaryTags.add(canaryTagsItem); return this; @@ -240,7 +263,7 @@ public Service checks(List checks) { public Service addChecksItem(ServiceCheck checksItem) { if (this.checks == null) { - this.checks = new ArrayList(); + this.checks = new ArrayList<>(); } this.checks.add(checksItem); return this; @@ -317,7 +340,7 @@ public Service meta(Map meta) { public Service putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -471,7 +494,7 @@ public Service tags(List tags) { public Service addTagsItem(String tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; @@ -517,6 +540,7 @@ public void setTaskName(String taskName) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -544,11 +568,22 @@ public boolean equals(Object o) { Objects.equals(this.taskName, service.taskName); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(address, addressMode, canaryMeta, canaryTags, checkRestart, checks, connect, enableTagOverride, meta, name, onUpdate, portLabel, provider, taggedAddresses, tags, taskName); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -584,5 +619,153 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Address"); + openapiFields.add("AddressMode"); + openapiFields.add("CanaryMeta"); + openapiFields.add("CanaryTags"); + openapiFields.add("CheckRestart"); + openapiFields.add("Checks"); + openapiFields.add("Connect"); + openapiFields.add("EnableTagOverride"); + openapiFields.add("Meta"); + openapiFields.add("Name"); + openapiFields.add("OnUpdate"); + openapiFields.add("PortLabel"); + openapiFields.add("Provider"); + openapiFields.add("Tags"); + openapiFields.add("TaskName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Service + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Service.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Service is not found in the empty JSON string", Service.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Service.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Service` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Address") != null && !jsonObj.get("Address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address").toString())); + } + if (jsonObj.get("AddressMode") != null && !jsonObj.get("AddressMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AddressMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AddressMode").toString())); + } + // ensure the json data is an array + if (jsonObj.get("CanaryTags") != null && !jsonObj.get("CanaryTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CanaryTags` to be an array in the JSON string but got `%s`", jsonObj.get("CanaryTags").toString())); + } + // validate the optional field `CheckRestart` + if (jsonObj.getAsJsonObject("CheckRestart") != null) { + CheckRestart.validateJsonObject(jsonObj.getAsJsonObject("CheckRestart")); + } + JsonArray jsonArraychecks = jsonObj.getAsJsonArray("Checks"); + if (jsonArraychecks != null) { + // ensure the json data is an array + if (!jsonObj.get("Checks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Checks` to be an array in the JSON string but got `%s`", jsonObj.get("Checks").toString())); + } + + // validate the optional field `Checks` (array) + for (int i = 0; i < jsonArraychecks.size(); i++) { + ServiceCheck.validateJsonObject(jsonArraychecks.get(i).getAsJsonObject()); + }; + } + // validate the optional field `Connect` + if (jsonObj.getAsJsonObject("Connect") != null) { + ConsulConnect.validateJsonObject(jsonObj.getAsJsonObject("Connect")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("OnUpdate") != null && !jsonObj.get("OnUpdate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OnUpdate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OnUpdate").toString())); + } + if (jsonObj.get("PortLabel") != null && !jsonObj.get("PortLabel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PortLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PortLabel").toString())); + } + if (jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Tags") != null && !jsonObj.get("Tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Tags` to be an array in the JSON string but got `%s`", jsonObj.get("Tags").toString())); + } + if (jsonObj.get("TaskName") != null && !jsonObj.get("TaskName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TaskName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TaskName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Service.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Service' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Service.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Service value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Service read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Service given an JSON string + * + * @param jsonString JSON string + * @return An instance of Service + * @throws IOException if the JSON string is invalid with respect to Service + */ + public static Service fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Service.class); + } + + /** + * Convert an instance of Service to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceCheck.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceCheck.java index 2921a44f..af2f9bd6 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceCheck.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceCheck.java @@ -28,6 +28,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * ServiceCheck @@ -130,6 +151,8 @@ public class ServiceCheck { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public ServiceCheck() { + } public ServiceCheck addressMode(String addressMode) { @@ -185,7 +208,7 @@ public ServiceCheck args(List args) { public ServiceCheck addArgsItem(String argsItem) { if (this.args == null) { - this.args = new ArrayList(); + this.args = new ArrayList<>(); } this.args.add(argsItem); return this; @@ -377,7 +400,7 @@ public ServiceCheck header(Map> header) { public ServiceCheck putHeaderItem(String key, List headerItem) { if (this.header == null) { - this.header = new HashMap>(); + this.header = new HashMap<>(); } this.header.put(key, headerItem); return this; @@ -699,6 +722,7 @@ public void setType(String type) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -734,11 +758,22 @@ public boolean equals(Object o) { Objects.equals(this.type, serviceCheck.type); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(addressMode, advertise, args, body, checkRestart, command, expose, failuresBeforeCritical, grPCService, grPCUseTLS, header, initialStatus, interval, method, name, onUpdate, path, portLabel, protocol, successBeforePassing, tlSSkipVerify, taskName, timeout, type); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -782,5 +817,163 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("AddressMode"); + openapiFields.add("Advertise"); + openapiFields.add("Args"); + openapiFields.add("Body"); + openapiFields.add("CheckRestart"); + openapiFields.add("Command"); + openapiFields.add("Expose"); + openapiFields.add("FailuresBeforeCritical"); + openapiFields.add("GRPCService"); + openapiFields.add("GRPCUseTLS"); + openapiFields.add("Header"); + openapiFields.add("InitialStatus"); + openapiFields.add("Interval"); + openapiFields.add("Method"); + openapiFields.add("Name"); + openapiFields.add("OnUpdate"); + openapiFields.add("Path"); + openapiFields.add("PortLabel"); + openapiFields.add("Protocol"); + openapiFields.add("SuccessBeforePassing"); + openapiFields.add("TLSSkipVerify"); + openapiFields.add("TaskName"); + openapiFields.add("Timeout"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ServiceCheck + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ServiceCheck.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ServiceCheck is not found in the empty JSON string", ServiceCheck.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ServiceCheck.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServiceCheck` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("AddressMode") != null && !jsonObj.get("AddressMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AddressMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AddressMode").toString())); + } + if (jsonObj.get("Advertise") != null && !jsonObj.get("Advertise").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Advertise` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Advertise").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Args") != null && !jsonObj.get("Args").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Args` to be an array in the JSON string but got `%s`", jsonObj.get("Args").toString())); + } + if (jsonObj.get("Body") != null && !jsonObj.get("Body").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Body").toString())); + } + // validate the optional field `CheckRestart` + if (jsonObj.getAsJsonObject("CheckRestart") != null) { + CheckRestart.validateJsonObject(jsonObj.getAsJsonObject("CheckRestart")); + } + if (jsonObj.get("Command") != null && !jsonObj.get("Command").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Command` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Command").toString())); + } + if (jsonObj.get("GRPCService") != null && !jsonObj.get("GRPCService").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GRPCService` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GRPCService").toString())); + } + if (jsonObj.get("InitialStatus") != null && !jsonObj.get("InitialStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InitialStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InitialStatus").toString())); + } + if (jsonObj.get("Method") != null && !jsonObj.get("Method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Method").toString())); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + if (jsonObj.get("OnUpdate") != null && !jsonObj.get("OnUpdate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OnUpdate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OnUpdate").toString())); + } + if (jsonObj.get("Path") != null && !jsonObj.get("Path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Path").toString())); + } + if (jsonObj.get("PortLabel") != null && !jsonObj.get("PortLabel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PortLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PortLabel").toString())); + } + if (jsonObj.get("Protocol") != null && !jsonObj.get("Protocol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Protocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Protocol").toString())); + } + if (jsonObj.get("TaskName") != null && !jsonObj.get("TaskName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TaskName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TaskName").toString())); + } + if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServiceCheck.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServiceCheck' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServiceCheck.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServiceCheck value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServiceCheck read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ServiceCheck given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceCheck + * @throws IOException if the JSON string is invalid with respect to ServiceCheck + */ + public static ServiceCheck fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServiceCheck.class); + } + + /** + * Convert an instance of ServiceCheck to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceRegistration.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceRegistration.java index 3d97e5ef..9cfb4b6d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceRegistration.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/ServiceRegistration.java @@ -26,6 +26,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * ServiceRegistration */ @@ -79,6 +99,8 @@ public class ServiceRegistration { @SerializedName(SERIALIZED_NAME_TAGS) private List tags = null; + public ServiceRegistration() { + } public ServiceRegistration address(String address) { @@ -345,7 +367,7 @@ public ServiceRegistration tags(List tags) { public ServiceRegistration addTagsItem(String tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; @@ -368,6 +390,7 @@ public void setTags(List tags) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -427,5 +450,129 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Address"); + openapiFields.add("AllocID"); + openapiFields.add("CreateIndex"); + openapiFields.add("Datacenter"); + openapiFields.add("ID"); + openapiFields.add("JobID"); + openapiFields.add("ModifyIndex"); + openapiFields.add("Namespace"); + openapiFields.add("NodeID"); + openapiFields.add("Port"); + openapiFields.add("ServiceName"); + openapiFields.add("Tags"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ServiceRegistration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ServiceRegistration.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ServiceRegistration is not found in the empty JSON string", ServiceRegistration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ServiceRegistration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServiceRegistration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Address") != null && !jsonObj.get("Address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address").toString())); + } + if (jsonObj.get("AllocID") != null && !jsonObj.get("AllocID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AllocID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AllocID").toString())); + } + if (jsonObj.get("Datacenter") != null && !jsonObj.get("Datacenter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Datacenter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Datacenter").toString())); + } + if (jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (jsonObj.get("JobID") != null && !jsonObj.get("JobID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JobID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JobID").toString())); + } + if (jsonObj.get("Namespace") != null && !jsonObj.get("Namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Namespace").toString())); + } + if (jsonObj.get("NodeID") != null && !jsonObj.get("NodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NodeID").toString())); + } + if (jsonObj.get("ServiceName") != null && !jsonObj.get("ServiceName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ServiceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ServiceName").toString())); + } + // ensure the json data is an array + if (jsonObj.get("Tags") != null && !jsonObj.get("Tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Tags` to be an array in the JSON string but got `%s`", jsonObj.get("Tags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServiceRegistration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServiceRegistration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServiceRegistration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServiceRegistration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServiceRegistration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ServiceRegistration given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceRegistration + * @throws IOException if the JSON string is invalid with respect to ServiceRegistration + */ + public static ServiceRegistration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServiceRegistration.class); + } + + /** + * Convert an instance of ServiceRegistration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SidecarTask.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SidecarTask.java index dcaa14ae..9b99369e 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SidecarTask.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SidecarTask.java @@ -28,6 +28,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * SidecarTask @@ -78,6 +99,8 @@ public class SidecarTask { @SerializedName(SERIALIZED_NAME_USER) private String user; + public SidecarTask() { + } public SidecarTask config(Map config) { @@ -87,7 +110,7 @@ public SidecarTask config(Map config) { public SidecarTask putConfigItem(String key, Object configItem) { if (this.config == null) { - this.config = new HashMap(); + this.config = new HashMap<>(); } this.config.put(key, configItem); return this; @@ -141,7 +164,7 @@ public SidecarTask env(Map env) { public SidecarTask putEnvItem(String key, String envItem) { if (this.env == null) { - this.env = new HashMap(); + this.env = new HashMap<>(); } this.env.put(key, envItem); return this; @@ -241,7 +264,7 @@ public SidecarTask meta(Map meta) { public SidecarTask putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -356,6 +379,7 @@ public void setUser(String user) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -378,11 +402,22 @@ public boolean equals(Object o) { Objects.equals(this.user, sidecarTask.user); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(config, driver, env, killSignal, killTimeout, logConfig, meta, name, resources, shutdownDelay, user); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -413,5 +448,120 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Config"); + openapiFields.add("Driver"); + openapiFields.add("Env"); + openapiFields.add("KillSignal"); + openapiFields.add("KillTimeout"); + openapiFields.add("LogConfig"); + openapiFields.add("Meta"); + openapiFields.add("Name"); + openapiFields.add("Resources"); + openapiFields.add("ShutdownDelay"); + openapiFields.add("User"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SidecarTask + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SidecarTask.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SidecarTask is not found in the empty JSON string", SidecarTask.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SidecarTask.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SidecarTask` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Driver") != null && !jsonObj.get("Driver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Driver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Driver").toString())); + } + if (jsonObj.get("KillSignal") != null && !jsonObj.get("KillSignal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `KillSignal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("KillSignal").toString())); + } + // validate the optional field `LogConfig` + if (jsonObj.getAsJsonObject("LogConfig") != null) { + LogConfig.validateJsonObject(jsonObj.getAsJsonObject("LogConfig")); + } + if (jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString())); + } + // validate the optional field `Resources` + if (jsonObj.getAsJsonObject("Resources") != null) { + Resources.validateJsonObject(jsonObj.getAsJsonObject("Resources")); + } + if (jsonObj.get("User") != null && !jsonObj.get("User").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `User` to be a primitive type in the JSON string but got `%s`", jsonObj.get("User").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SidecarTask.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SidecarTask' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SidecarTask.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SidecarTask value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SidecarTask read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SidecarTask given an JSON string + * + * @param jsonString JSON string + * @return An instance of SidecarTask + * @throws IOException if the JSON string is invalid with respect to SidecarTask + */ + public static SidecarTask fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SidecarTask.class); + } + + /** + * Convert an instance of SidecarTask to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Spread.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Spread.java index 009d060d..ccd1b89d 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Spread.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Spread.java @@ -27,6 +27,26 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * Spread */ @@ -44,6 +64,8 @@ public class Spread { @SerializedName(SERIALIZED_NAME_WEIGHT) private Integer weight; + public Spread() { + } public Spread attribute(String attribute) { @@ -76,7 +98,7 @@ public Spread spreadTarget(List spreadTarget) { public Spread addSpreadTargetItem(SpreadTarget spreadTargetItem) { if (this.spreadTarget == null) { - this.spreadTarget = new ArrayList(); + this.spreadTarget = new ArrayList<>(); } this.spreadTarget.add(spreadTargetItem); return this; @@ -124,6 +146,7 @@ public void setWeight(Integer weight) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -165,5 +188,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Attribute"); + openapiFields.add("SpreadTarget"); + openapiFields.add("Weight"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Spread + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Spread.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Spread is not found in the empty JSON string", Spread.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Spread.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Spread` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Attribute") != null && !jsonObj.get("Attribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Attribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Attribute").toString())); + } + JsonArray jsonArrayspreadTarget = jsonObj.getAsJsonArray("SpreadTarget"); + if (jsonArrayspreadTarget != null) { + // ensure the json data is an array + if (!jsonObj.get("SpreadTarget").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SpreadTarget` to be an array in the JSON string but got `%s`", jsonObj.get("SpreadTarget").toString())); + } + + // validate the optional field `SpreadTarget` (array) + for (int i = 0; i < jsonArrayspreadTarget.size(); i++) { + SpreadTarget.validateJsonObject(jsonArrayspreadTarget.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Spread.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Spread' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Spread.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Spread value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Spread read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Spread given an JSON string + * + * @param jsonString JSON string + * @return An instance of Spread + * @throws IOException if the JSON string is invalid with respect to Spread + */ + public static Spread fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Spread.class); + } + + /** + * Convert an instance of Spread to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/SpreadTarget.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/SpreadTarget.java index 1236ec23..cd67aca8 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/SpreadTarget.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/SpreadTarget.java @@ -24,6 +24,26 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; + /** * SpreadTarget */ @@ -37,6 +57,8 @@ public class SpreadTarget { @SerializedName(SERIALIZED_NAME_VALUE) private String value; + public SpreadTarget() { + } public SpreadTarget percent(Integer percent) { @@ -86,6 +108,7 @@ public void setValue(String value) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -125,5 +148,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Percent"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SpreadTarget + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SpreadTarget.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SpreadTarget is not found in the empty JSON string", SpreadTarget.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpreadTarget.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpreadTarget` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpreadTarget.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpreadTarget' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SpreadTarget.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SpreadTarget value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpreadTarget read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SpreadTarget given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpreadTarget + * @throws IOException if the JSON string is invalid with respect to SpreadTarget + */ + public static SpreadTarget fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpreadTarget.class); + } + + /** + * Convert an instance of SpreadTarget to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/v1/src/main/java/io/nomadproject/client/models/Task.java b/clients/java/v1/src/main/java/io/nomadproject/client/models/Task.java index 69fcb886..25da96d9 100644 --- a/clients/java/v1/src/main/java/io/nomadproject/client/models/Task.java +++ b/clients/java/v1/src/main/java/io/nomadproject/client/models/Task.java @@ -41,6 +41,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.nomadproject.client.JSON; /** * Task @@ -147,6 +168,8 @@ public class Task { @SerializedName(SERIALIZED_NAME_VOLUME_MOUNTS) private List volumeMounts = null; + public Task() { + } public Task affinities(List affinities) { @@ -156,7 +179,7 @@ public Task affinities(List affinities) { public Task addAffinitiesItem(Affinity affinitiesItem) { if (this.affinities == null) { - this.affinities = new ArrayList(); + this.affinities = new ArrayList<>(); } this.affinities.add(affinitiesItem); return this; @@ -187,7 +210,7 @@ public Task artifacts(List artifacts) { public Task addArtifactsItem(TaskArtifact artifactsItem) { if (this.artifacts == null) { - this.artifacts = new ArrayList(); + this.artifacts = new ArrayList<>(); } this.artifacts.add(artifactsItem); return this; @@ -241,7 +264,7 @@ public Task config(Map config) { public Task putConfigItem(String key, Object configItem) { if (this.config == null) { - this.config = new HashMap(); + this.config = new HashMap<>(); } this.config.put(key, configItem); return this; @@ -272,7 +295,7 @@ public Task constraints(List constraints) { public Task addConstraintsItem(Constraint constraintsItem) { if (this.constraints == null) { - this.constraints = new ArrayList(); + this.constraints = new ArrayList<>(); } this.constraints.add(constraintsItem); return this; @@ -349,7 +372,7 @@ public Task env(Map env) { public Task putEnvItem(String key, String envItem) { if (this.env == null) { - this.env = new HashMap(); + this.env = new HashMap<>(); } this.env.put(key, envItem); return this; @@ -518,7 +541,7 @@ public Task meta(Map meta) { public Task putMetaItem(String key, String metaItem) { if (this.meta == null) { - this.meta = new HashMap(); + this.meta = new HashMap<>(); } this.meta.put(key, metaItem); return this; @@ -618,7 +641,7 @@ public Task scalingPolicies(List scalingPolicies) { public Task addScalingPoliciesItem(ScalingPolicy scalingPoliciesItem) { if (this.scalingPolicies == null) { - this.scalingPolicies = new ArrayList(); + this.scalingPolicies = new ArrayList<>(); } this.scalingPolicies.add(scalingPoliciesItem); return this; @@ -649,7 +672,7 @@ public Task services(List services) { public Task addServicesItem(Service servicesItem) { if (this.services == null) { - this.services = new ArrayList(); + this.services = new ArrayList<>(); } this.services.add(servicesItem); return this; @@ -703,7 +726,7 @@ public Task templates(List